Recognizing checkboxes in azure form recognizer - microsoft-cognitive

The forms I want to use in form recognizer have several checkboxes. Currently, form recognizer's OCR engine doesn't seem to detect checkboxes. Is there a work-around for this, or is there a way to train checkbox recognition?
I've also tried using tesseract on windows and linux, but I couldn't solve it there either.
The checkboxes are your standard open squares. Sometimes they may have an "x" or checkmark on them.
If there is no solution, then I may ask the customer to change from checkboxes to filled in circles (radio-buttons). I haven't tested that yet, to see what OCR would make of them.
Edit: I read the form recognizer documentation and I saw that it explicitly says checkboxes and radio buttons are not supported. I wonder if anyone has a awork-around?

An OCR is by definition made for "character recognition" (see here). A checkbox or a radio button is not a character, so it will not be recognized by an OCR.
You can still give a try to a custom vision detector to find those items, but it will be a bit complicated as this service will only find those items in your document and you will have to combine with an OCR call to get the text, then try to match the zones in the document to know which text is associated with which combo/radio button

Support for checkboxes was added to Form Recognizer in version 2.1 (in public preview as of September 2020). From the announcement:
Checkbox / Selection Mark detection – Form Recognizer supports
detection and extraction of selection marks such as check boxes and
radio buttons. Selection Marks are extracted in Layout and you can now
also label and train in Train Custom Model - Train with Labels to
extract key value pairs for selection marks.
There is now a selectionMarks object in the Get Analyze Layout Result API response that lists detected selection marks and their state, either selected or unselected.
Support for labeling checkboxes and selection marks was also added to the sample labeling tool as of version 2.1.

In Form Recognizer if the forms have a consistent layout, you might be able to tag the area using the new GUI tool and pass that specific area to OCR to try to improve results.

The method #Ram-msft suggested can work, but I find that the recognizer struggles to consistently pick out any single characters in a box - although to be honest checkbox type boxes seem to work better than say a number in a box (in my experience at least).
As long as you're interested in any "value" inside the box (i.e. it's not empty) then that method should give you reasonable results until they come up with a true solution.

Related

Selection Marks recognition in Forms Recognizer

I'd like to recognize selection-marks (yes/no, [x]/[ ]) with the form-recognizer. I'm using the labeling tool and wondering if it's possible and if so how? The third layer of the labeling tool is named "Selection Marks", so this may be something which is in the works.
Selection marks / Checkboxes are now available in Forms Recognizer API 2.1 https://westus.dev.cognitive.microsoft.com/docs/services/form-recognizer-api-v2-1/operations/AnalyzeWithCustomForm
Form Recognizer does not yet support check boxes and selection Marks, this feature is coming soon stay tuned.
Neta - MSFT

Vaadin numeric field?

Is there a DoubleField or LongField Vaadin 7? I see a TextField and PasswordField, so it sort of shocked me when I did not see fields for numeric types. This seems so standard, especially since GWT has such fields under the hood, that I feel like I am missing something.
Also, there are some numeric field add-ons, but most of them say they don't support Vaadin 7, which leads me to believe there is some standard way to do it in Vaadin 7 already. Am I missing something?
I couldn't find a way either but I created my own with a custom TextChangeListener. Basically you override the method textChange(TextChangeEvent event) to check if the value is valid. If it's not valid then you delete it. Just be careful to adjust the cursor appropriately. I created a listener for integers (with max/mins), one for doubles, percentages, etc. Basically any kind of number validation you need. The tricky part is managing the cursor position. I wish I had some sample code to show you but I don't have it available on my current computer, but at least this should give you a running start.

Fuzzy autocomplete textbox control in ASP.NET

What is the best approximation algorithm to implement full-text fuzzy search. For example we have a dropdownlist with the following data (from SQL datasource):
Company Policy
Product Catelog
Our Partners
Now I want to replace it with an autocomplete textbox, such that when the letter "p" is typed the list shows all three results. It should start matching the first letter of the first word or second word and so on. Also, it should highlight or make the matched letters bold in the suggestions dropdown.
Is there a readymade control for ASP.NET (with JS or jQuery) to deliver all the aforementioned functionality? Otherwise if I have to implement it, is there a tutorial/blog which point me in the right direction?
I believe this is what you're looking for.
It's jquery ui it has the autocomplete functionality described.
check out this one, I used it and works very well
http://www.asp.net/ajaxLibrary/AjaxControlToolkitSampleSite/AutoComplete/AutoComplete.aspx

What is the purpose of a value converter in Silverlight?

I'm just starting to get my hands dirty with silverlight and "value converter" keeps popping up. I don't remember reading about them in the ASP.NET web app world. Is this something special in Silverlight/WPF? What is its purpose?
Thanks!
From this excellent post:
When you’re binding data to controls there will be times when the data needs to be modified or tweaked some on the way into a control or as the data leaves a control and goes back to the source property (during a TwoWay binding for example).  Sure, you can always write code to change a given value, but in many cases it’s much easier to write a simple value converter instead that can be re-used.  In this post I’ll walk through creating a value converter and then show the code for a few of the value converters I find myself using fairly frequently.
There is stark contrast between the web platform and the Windows when it comes to data binding. Especially in WPF / Silverlight / Windows Phone 7. These technologies support databinding differently compared to Web which is stateless.
A very common example of a value convertor is when you want to hide or show a control in WPF / Silverlight. Controls like stack panel have visibility property which is an enum. We can assign values like Visible / Collapse / Hidden to show or hide the stack panel. In most cases the visibility is controlled by a boolean value. So you use a convertor to convert the boolean to visibility.
Another example of value convertor could be formatting of amount fields. Say you want to display 1000 which is stored in the database as $1,000.00 in an amount text box. You can use the value convertor to do so.
The possibilities are endless. You can think of value convertor as a visual representation of something. Another example I can think of is the completion progress of any task. You can show a nice colourful progressbar instead of showing values like 10%, 20%, 30% completed :)
Hope this helps.

Latitude/Longitude Qt4 widget?

What is the best starting point for a Qt4 widget for entering Latitude/Longitude in DD:MM:SS format (degrees, minutes, seconds)? Customize a QLineEdit? A series of spin boxes?
There are some variants:
QLineEdit with Validator - wasn't good enough for us, we couldn't achieve usable editing and proper view (with ', '' and degree symbols in place and ability to forbid incorrect values and still allow semi-correct states, and the target behaviour is not to mark errors and force user to fix them, but to allow user to enter only valid values).
Three spin edits in a line with the proper symbols between them grouped as a single widget and some code to move keyboard input from one no next when needed etc. Looks good enough in some cases, and you can find the variant of realization in the famous Marble project.
Still, my boss said that this approach is almost as ugly as first, so here is another approach: subclass QAbstractSpinBox, as Trolltech did in their QDateTimeEditor. In fact, behaviour of such a widget is near similar to one, implemented in QDateTimeEditor.
I, myself didn't do it yet, cause of task priorities, but will have to do.
I would use a QValidator, attaching it to a QLineEdit using QLineEdit::setValidator().
You'll need to subclass so you can implement the validate() function and possibly the fixup() function for your particular case, since the two validators included with Qt only cover integers and doubles.
It's a bit friendlier, in my opinion, to provide a single input box for this rather than three separate spin boxes (which could look cluttered and isn't as nice to type in).
[Edit: One other alternative is to set a "validation input mask" on your QLineEdit using QLineEdit::setInputMask(). You might want a line edit with symbols already in place and placeholders for other characters, for example, and this approach will give you something similar to that. The QtDemo app has an example of this which you can check out by choosing Widgets->Line Edits (Widgets is on the second page).]

Resources