Cloud Development Kit

Multiple result choices

Hi all,
I'm trying to use MyScript, and wondering if I can obtain multiple recognition results. If I can, how?

Ps, I'm using CDK and testing on web.

Thanks


Dear Sir,
Get multiple recognition results is possible with CDK Text, this post may interest you:
https://developer-support.myscript.com/support/discussions/topics/16000007800
Don’t hesitate to check the api documentation as well:
http://doc.myscript.com/MyScriptCloud/3.0.0/reference/index.html

Best regards

Thanks for your reply, very helpful!

I read all the api documents and download several cdk samples, but I still confused where I can revise the parameter and how to deliever it to cloud.

I tried to revise options in index.html under rest directory but I failed.

Thanks in advance, sorry for my naive question.

I hope this text request example will help you:
{inputUnits: [{textInputType: MULTI_LINE_TEXT, components: [{y: [361, 361, 360, 358, 357, 354, 352, 350, 348, 345, 342, 340, 338, 335, 333, 330, 326, 322, 316, 310, 303, 298, 292, 286, 279, 274, 269, 263, 259, 253, 247, 241, 233, 229, 223, 216, 210, 205, 198, 192, 186, 180, 177, 172, 168, 165, 160, 156, 152, 148, 143, 139, 134, 130, 127, 124, 121, 118, 116, 113, 111, 110, 107, 106, 105, 104, 104, 103, 102, 102, 102, 102, 102, 102, 102, 102, 102, 103, 103, 105, 106, 108, 109, 111, 112, 113, 115, 116, 119, 121, 124, 127, 130, 133, 135, 138, 141, 142, 144, 146, 147, 148, 151, 152, 154, 157, 163, 167, 172, 176, 182, 186, 191, 195, 200, 206, 210, 215, 220, 226, 233, 239, 244, 248, 253, 256, 259, 262, 265, 267, 271, 273, 276, 279, 283, 286, 288, 292, 294, 296, 298, 301, 302, 304, 306, 308, 310, 312, 315, 317, 320, 321, 325, 326, 329, 331, 332, 333, 334, 335, 337, 338, 339, 339, 341, 342, 342, 343, 343, 344, 345, 345, 346, 347, 347, 348, 349, 349, 349, 350, 351, 351, 351, 351, 351, 352, 352, 353, 353, 353, 353, 353, 353, 353, 353, 353, 352, 352, 351, 351, 350, 350, 350, 350, 349, 349, 348, 348, 348, 348, 348, 347, 347, 346, 345, 345, 343, 343, 342, 341, 341, 340, 339, 339, 338, 337, 335, 335, 334, 332, 330, 329, 327, 326, 325, 324, 322, 321, 320, 319, 318, 316, 315, 314, 311, 310, 309, 307, 305, 305, 304, 303, 302, 301, 300, 299, 298, 297, 296, 295, 295, 294, 293, 292, 291, 289, 288, 285, 283, 281, 278, 275, 273, 269, 266, 264, 261, 259, 256, 253, 250, 247, 244, 241, 238, 234, 231, 229, 225, 221, 218, 216, 215, 212, 212, 211, 210, 210, 209, 209, 209, 209, 209, 209, 209, 209, 210, 213, 215, 219, 225, 230, 235, 241, 244, 248, 251, 253, 256, 258, 260, 261, 263, 264, 265, 266, 267, 268, 269, 270, 271, 273, 274, 275, 277, 279, 281, 282, 283, 285, 287, 288, 289, 290, 290, 290, 291, 292, 293, 293, 295, 296, 298, 299, 300, 303, 304, 306, 308, 309, 310, 312, 314, 315, 316, 318, 320, 321, 323, 325, 327, 329, 331, 335, 338, 342, 345, 350, 354, 356, 360, 363, 366, 369, 372, 374, 376, 378, 380, 380, 381, 381, 380, 378, 374, 370, 365, 359, 353, 348, 343, 336, 327, 317, 310, 302, 294, 286, 278, 270, 264, 258, 254, 250, 245, 243, 239, 235, 233, 229, 225, 223, 221, 220, 219, 219, 218, 218, 218, 218, 218, 218, 220, 221, 223, 226, 229, 233, 237, 241, 246, 248, 250, 252, 255, 259, 262, 267, 273, 277, 281, 284, 289, 291, 294, 298, 301, 304, 308, 312, 316, 319, 323, 325, 327, 328, 330, 330, 331, 332, 332, 333, 334, 334, 335, 336, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 337, 336, 336, 336, 335, 335, 335, 335, 334, 333, 332, 332, 330, 330, 328, 327, 326, 324, 323, 323, 321, 319, 318, 315, 314, 312, 310, 309, 307, 307, 304, 304, 301, 299, 296, 291, 284, 278, 272, 268, 263, 258, 253, 248, 245, 240, 237, 233, 229, 225, 219, 215, 210, 205, 200, 197, 194, 191, 189, 188, 188, 188, 190, 193, 201, 208, 217, 226, 232, 235, 240, 243, 246, 250, 253, 258, 262, 268, 277, 283, 290, 295, 300, 303, 305, 307, 309, 312, 314, 316, 320, 323, 328, 332, 335, 337, 338, 340, 340, 341, 341, 342, 342, 342, 342, 342, 341, 339, 336, 333, 330, 326, 321, 318, 313, 309, 304, 298, 291, 283, 274, 266, 258, 251, 242, 236, 227, 218, 208, 200, 190, 181, 171, 163, 154, 147, 140, 133, 126, 120, 114, 107, 101, 94, 87, 81, 75, 70, 67, 63, 58, 56, 53, 52, 52, 51, 50, 50, 49, 49, 48, 47, 46, 46, 46, 46, 46, 48, 52, 55, 59, 63, 68, 74, 79, 85, 90, 97, 103, 108, 115, 122, 131, 142, 154, 166, 180, 193, 209, 221, 232, 243, 256, 271, 282, 295, 305, 313, 322, 330, 336, 340, 343, 345, 346, 347, 350, 352, 354, 358, 359, 361, 362, 363, 364, 364, 365, 365, 365, 365, 365, 364, 364, 363, 362, 361, 361, 360, 359, 357, 354, 353, 351, 347, 345, 343, 339, 338, 335, 332, 330, 328, 325, 321, 318, 312, 307, 301, 296, 289, 281, 272, 265, 255, 244, 233, 225, 215, 204, 193, 183, 172, 161, 150, 140, 133, 128, 122, 118, 114, 111, 109, 108, 108, 109, 109, 109, 110, 111, 111, 111, 111, 112, 112, 113, 114, 114, 116, 117, 120, 122, 124, 126, 127, 129, 130, 131, 132, 133, 134, 136, 138, 141, 144, 147, 150, 154, 159, 163, 169, 173, 180, 188, 198, 207, 220, 231, 244, 256, 270, 281, 291, 300, 308, 315, 322, 328, 334, 339, 345, 350, 355, 359, 363, 365, 368, 371, 372, 374, 375, 377, 380, 382, 385, 388, 391, 393, 394, 395, 395, 395, 394, 392, 389, 388, 385, 382, 377, 375, 371, 369, 366, 363, 360, 357, 353, 350, 347, 344, 341, 338, 336, 334, 331, 329, 327, 324, 321, 318, 315, 312, 309, 308, 307, 306, 305, 304, 303, 302, 300, 299, 298, 296, 295, 294, 293, 291, 290, 289, 288, 287, 286, 285, 284, 282, 281, 279, 279, 278, 277, 277, 277, 277, 277, 278, 279, 283, 285, 290, 292, 294, 296, 297, 298, 299, 302, 307, 309, 314, 317, 319, 322, 322, 324, 325, 326, 326, 326, 326, 326, 326, 324, 323, 320, 317, 313, 309, 303, 300, 298, 295, 293], x: [76, 79, 83, 85, 89, 95, 101, 106, 111, 117, 120, 124, 126, 129, 130, 133, 135, 137, 139, 141, 143, 146, 148, 151, 152, 155, 158, 160, 163, 165, 167, 170, 172, 175, 177, 179, 181, 182, 184, 187, 189, 191, 192, 194, 195, 196, 197, 197, 197, 197, 198, 198, 198, 198, 196, 196, 194, 193, 192, 190, 189, 187, 186, 184, 183, 182, 180, 179, 178, 177, 176, 175, 174, 172, 171, 169, 168, 166, 165, 163, 161, 160, 159, 158, 157, 156, 156, 156, 155, 155, 155, 155, 154, 154, 153, 153, 153, 152, 152, 152, 152, 151, 150, 150, 150, 150, 150, 149, 148, 147, 146, 144, 143, 142, 141, 140, 139, 138, 137, 136, 136, 136, 136, 136, 136, 137, 137, 137, 137, 138, 140, 140, 141, 143, 145, 145, 146, 148, 149, 149, 151, 152, 152, 153, 154, 154, 155, 156, 157, 158, 159, 160, 161, 162, 163, 164, 164, 164, 165, 166, 166, 167, 167, 168, 169, 170, 171, 171, 172, 173, 174, 175, 175, 177, 178, 180, 181, 182, 183, 184, 186, 187, 188, 189, 190, 191, 192, 193, 194, 195, 196, 197, 198, 199, 200, 201, 202, 203, 204, 205, 206, 207, 208, 209, 209, 210, 210, 211, 212, 213, 214, 215, 216, 218, 220, 222, 223, 224, 225, 225, 227, 228, 228, 229, 229, 230, 230, 231, 231, 231, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 232, 231, 231, 230, 230, 229, 228, 228, 227, 227, 226, 226, 225, 224, 224, 223, 223, 221, 221, 220, 219, 218, 217, 215, 214, 213, 211, 209, 207, 206, 204, 202, 200, 199, 198, 197, 196, 195, 195, 194, 194, 194, 194, 194, 196, 198, 199, 200, 204, 206, 208, 210, 212, 215, 217, 219, 222, 224, 227, 228, 229, 231, 232, 233, 236, 238, 240, 244, 247, 252, 254, 258, 261, 263, 265, 266, 267, 268, 268, 269, 269, 269, 269, 269, 269, 268, 268, 268, 268, 267, 267, 267, 267, 266, 265, 264, 264, 263, 262, 261, 260, 260, 260, 259, 258, 258, 258, 258, 257, 257, 256, 255, 255, 255, 255, 255, 254, 254, 254, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 253, 254, 254, 256, 258, 260, 263, 267, 272, 277, 281, 286, 292, 300, 306, 312, 317, 325, 331, 336, 343, 347, 353, 359, 364, 370, 375, 379, 382, 386, 389, 392, 397, 401, 404, 407, 410, 413, 415, 416, 417, 417, 417, 417, 417, 415, 414, 411, 409, 405, 401, 396, 393, 390, 387, 384, 381, 378, 377, 374, 372, 369, 368, 365, 362, 359, 355, 353, 350, 347, 345, 344, 343, 343, 342, 342, 342, 342, 342, 343, 343, 344, 345, 346, 347, 348, 349, 350, 353, 355, 359, 360, 364, 366, 367, 368, 370, 371, 372, 374, 375, 378, 379, 380, 383, 384, 385, 386, 387, 388, 389, 390, 392, 393, 394, 396, 399, 402, 403, 405, 406, 407, 408, 410, 412, 413, 415, 417, 418, 421, 422, 423, 426, 427, 429, 432, 433, 434, 435, 436, 437, 440, 442, 445, 448, 450, 452, 455, 457, 459, 460, 461, 462, 464, 465, 467, 468, 470, 472, 474, 475, 476, 477, 477, 477, 477, 477, 477, 477, 477, 477, 476, 476, 474, 473, 471, 470, 469, 467, 467, 466, 464, 462, 458, 455, 450, 445, 441, 437, 435, 433, 433, 432, 432, 432, 432, 434, 436, 439, 443, 445, 448, 450, 452, 454, 456, 458, 460, 462, 465, 467, 470, 474, 478, 482, 485, 487, 489, 491, 493, 494, 495, 496, 498, 501, 503, 506, 508, 511, 513, 515, 518, 521, 522, 524, 526, 529, 531, 533, 536, 538, 540, 542, 543, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 544, 543, 542, 542, 539, 539, 536, 533, 530, 527, 525, 523, 520, 516, 514, 511, 510, 509, 508, 508, 507, 506, 505, 504, 502, 500, 498, 496, 495, 492, 489, 484, 480, 473, 468, 463, 458, 454, 451, 449, 447, 446, 445, 443, 443, 443, 443, 446, 448, 450, 454, 459, 461, 463, 466, 471, 477, 483, 487, 493, 498, 504, 509, 514, 518, 520, 521, 523, 524, 526, 528, 530, 532, 534, 536, 538, 540, 541, 542, 543, 544, 545, 546, 548, 550, 551, 552, 552, 553, 554, 554, 554, 555, 557, 557, 559, 561, 562, 564, 566, 568, 569, 571, 572, 574, 575, 575, 576, 578, 579, 581, 582, 583, 584, 586, 588, 590, 591, 593, 595, 595, 596, 597, 597, 597, 598, 598, 598, 599, 599, 599, 599, 598, 598, 596, 595, 593, 593, 592, 590, 588, 585, 582, 580, 577, 574, 571, 570, 567, 566, 565, 563, 561, 559, 558, 556, 555, 554, 553, 553, 553, 553, 553, 552, 552, 552, 552, 551, 551, 550, 549, 549, 548, 548, 547, 547, 547, 547, 547, 547, 547, 548, 549, 550, 552, 556, 559, 562, 566, 569, 573, 577, 582, 587, 592, 597, 601, 605, 608, 612, 614, 616, 619, 622, 626, 632, 638, 645, 654, 663, 671, 679, 687, 694, 702, 707, 712, 716, 720, 724, 727, 729, 731, 732, 733, 735, 735, 737, 737, 737, 737, 737, 738, 738, 738, 738, 738, 738, 738, 738, 738, 738, 737, 735, 734, 734, 733, 732, 732, 732, 731, 731, 729, 729, 728, 727, 726, 724, 724, 723, 722, 721, 721, 720, 719, 718, 717, 716, 715, 713, 712, 710, 709, 707, 706, 704, 702, 701, 698, 695, 693, 691, 690, 690, 689, 689, 689, 689, 691, 695, 700, 706, 713, 722, 730, 741, 751, 761, 769, 776, 781, 786, 790, 792, 795, 797, 798, 800, 802, 804, 806, 806, 807, 809, 809], type: stroke}]}], switchToChildren: true, textParameter: {textProperties: {textCandidateListSize: 5}, textInputMode: CURSIVE, resultDetail: TEXT, language: en_US}}

Please let us know if you face any issue.

Best regards

Thank you for your kind reply!

I'm not sure if I was clear. Now I'm able to use this site(https://developer.myscript.com/tools) to transfer my handwriting to JSON file with all parameters, and then I use chrome postman to post the parameters to https://cloud.myscript.com/api/v3.0/recognition/rest/text/doSimpleRecognition.json, so I can get recognition result. My question is how can I use CDK code or which library should I use to achieve the same function? Specifically, I tried MyScriptJS and myscript-text-web from Github, but I failed to figure out where I can change the parameters.

Thanks so much!

No problem, I should have asked what you are using actually.

At present, the web text component does not allow to use custom resources, we hope to provide with more features in the next release and will communicate as soon as it will be available.

If I summarize, you need to get several text candidates using several custom resources, so I advise you to do your tests with our cloud api (REST protocol) until a new version of our web component release.
Cloud api documentation:
http://doc.myscript.com/MyScriptCloud/3.0.0/reference/index.html

You can call several custom resources by adding the following in your request:
"userResources":["python","pythonkeywords"]}

Please let us if know if you have any other specific question.

Thanks again for your information.

I'm trying to figure out how to send request including so many parameters in javascript. I'd appreciate it if you have some samples code to do that.

My last question is how I can convert canvas to strokes, I mean after getting HTML Canvas, how I can get all parameters I need to send the request?

Thanks in advance again. By the way, Notify me of follow-up replies via email function is not working.

Regarding your second question, did you have a look at the following webinar:
https://dev.myscript.com/myscript-cdk-part-1-develop-your-first-cdk-application/

It is very useful to explain every step to create your CDK application.

Don't hesitate if you have specific question.

Best regards

I was looking for that, too!

Thanks cate! That's exactly what I want, I didn't find the link at develope site.

My last question is when I change the url at webinar code to https://cloud.myscript.com/api/v3.0/recognition/rest/text/doSimpleRecognition.json.

I always got a 400 bad request, I believe I changed all parameters according to API like following:

var url = https://cloud.myscript.com/api/v3.0/recognition/rest/text/doSimpleRecognition.json;

 var jsonPost = {
  switchToChildren: true,
  textParameter:{
   language: language,
   textInputMode: CURSIVE,
   resultDetail: WORD,
   textProperties: {
    textCandidateListSize: 3
   }
  },
  inputUnits: [{components: strokes}]
 };
 
 var data = {
  apiKey : apiKey,
  textInput : JSON.stringify(jsonPost)
 };


Thanks!

Login or Signup to post a comment