Custom recognition

MyScript’s recognition technology is very flexible. While the default configurations support common use cases, this page explains how you can fine tune them to address specific needs.

Why customize the recognition?

Interactive ink comes with a set of supported language with associated recognition configurations.

However, there are a few situations where you may want to adapt these provided configurations:

  • You need the engine to recognize some vocabulary that is not included within the default MyScript lexicons, like proper names. In this case, you may build and attach a custom lexicon.
  • You target different education levels with a math application and want to restrict the amount of symbols that MyScript can recognize: this will reduce some possible ambiguities (many math symbols are very similar) and improve the overall user experience. In that case, you can build and attach a custom math grammar.
  • You are building a form application and want to reduce some fields to only accept certain types of symbols, such as alphanumerical symbols, digits or even capital letters. In this case, consider building and attaching a subset knowledge.

Recognition resources

Resources are pieces of knowledge that can be attached to the recognition engine to make it able to recognize a given language or content.

Alphabet knowledge

An Alphabet knowledge (AK) is a resource that enables the engine to recognize individual characters for a given language and a given writing style. Default configurations include a cursive AK for each supported language.

You can only attach a single AK to an engine at a time.

Linguistic knowledge

A Linguistic knowledge (LK) is a resource that provides the engine with linguistic information for a given language. It allows the recognition engine to improve its accuracy by favoring words from its lexicon that are the most likely to occur. Default configurations include an LK for each supported language.

An LK is not mandatory but not attaching one often results in a significant accuracy drop. It may be relevant if you do not expect to write full meaningful words, for instance if you plan to filter a list with a few letters.

Default configurations for all languages but English variants also attach a “secondary English” LK that allows the engine to recognize a mix of the target language and English. Except for this particular case, it is not expected to mix languages together.

Lexicon

A lexicon is a resource that lists words that can be recognized in addition to what is included into linguistic knowledge resources.

You can build and attach your own custom lexicons.

Subset knowledge

A subset knowledge (SK) is a resource that restricts the number of text characters that the engine shall attempt to recognize. It thus corresponds to a restriction of an AK resource. It can be useful in a form application, for example, to restrict the authorized characters of an email field to alphanumerical characters, @ and a few allowed punctuation signs.

You can build and attach your own custom subset knowledge.

Math grammar

A math grammar is a resource that restricts the number of math symbols and rules that the engine shall be able to process. In education use cases, it can prove very useful to adapt the recognition to a given math level (for instance, only digits and basic operators for pupils).

You can build and attach your own custom math grammars.

Attaching resources

Whatever the web API you are using, once you have build your resource you have to upload it and give it a name into your developer account. Go to your cloud dashboard https://cloud.myscript.com, select ‘Resource’ tab and upload the resource file as shown below

You will then be able to add the parameter when you create your editor our your web-component.

MyScriptJS

With TEXT type configure your editor like this.

const configuration = {
  recognitionParams : {
    V4 : {
      // Text configuration
      text : {
        configuration : {
          customResources : ['test']
          addLKText : true
        }
      }
    }
  }
}

MyScript.register(editorElement,configuration)

With MATH type configure your editor like that.

const configuration = {
  recognitionParams : {
    V4 : {
      // Math configuration
      math : {
        customGrammar : 'test'
      }
    }
  }
}

MyScript.register(editorElement,configuration)

myscript-common-element

Attach the configuration like MyScriptJS.

myscript-text-web

Configure your web-component like this.

<myscript-text-web ... customresources="test" addlktext></myscript-text-web>

myscript-math-web

Configure your web-component like this.

<myscript-math-web ... customgrammar="test"></myscript-math-web>

We use cookies to ensure that we give you the best experience on our website Read the privacy policy