Hi @Niranjan Mahtole ,
Thank you for bringing this to our notice.
In order for the date conversion to work, 3 things are required from Form Recognizer Studio (FRS):
- Specify the Sub Type to “Date”
- Specify the Field Format to one of the values: “dmy”, “mdy”, “ymd” in fields.json file. This specifies the
year/month/day order. Without this info, Form Recognizer does not know how to interpret the
year/month/day value. (The functionality as of today is very limited) - The extracted date string must exactly match the year/month/day order as specified in the Field Format. If it
does not match, no conversation will happen.
o For example, if the user specifies "dmy", and the date string is "13-11-20", it will be converted to "2020- 11-13".
o However, if the "dmy" is still specified, but the date string is "11-15-20", the conversation won’t happen, as “15” is not a valid month.
The date conversion is supported natively by Form Recognizer 3.0 API. Here is the workaround:
- Start labeling as usual in Form Recognizer Studio (FRS), and specify the date fields as “Date” in FRS.
- Go to blob storage of the training files, there is a file called fields.json generated by FRS in the previous step.
- Download the fields.json and open it in an editor or Right click on file and click edit to make changes without downloading.
- Look for all nodes with “fieldType”:”date” in the “fields” section in fields.json.
- All matching nodes should have this additional value: “fieldFormat”:”not-specified”.
- Change “not-specified” value to one of the value: “dmy”, “mdy”, “ymd”
- Save and upload the fields.json back to the same folder in the blob storage.
- Train the model as usual
- The created model should now be able to convert the date strings if the extracted date string is valid, as mentioned in the item #3 above.
- Here is an example of the conversion. Note that the converted value will be in the “valueDate”.
Please let me know if you have more questions about this.
I hope this helps.
Regards,
Vasavi
If an answer is helpful, please click on or upvote
which might help other community members reading this thread.