InvoiceNet icon indicating copy to clipboard operation
InvoiceNet copied to clipboard

Training with JSON array object in json file: Not Working

Open anshulp2912 opened this issue 4 years ago • 1 comments

JSON given for Training: {
"total_amount": "850,456.00", "amount": ["2,000.00","1,000.00","1,000.00","2,000.00","1,000.00","2,000.00"] } invoiceNet_Doubt Note: Image taken from Google Images

I want to include multiple values for the same feature.. like the above-given example of "amount". Error:

Exception in Tkinter callback
Traceback (most recent call last):
  File "C:\Users\Anshul\Anaconda3\envs\CO\lib\tkinter\__init__.py", line 1705, in __call__
    return self.func(*args)
  File "C:\Users\Anshul\InvoiceNet\invoicenet\gui\trainer.py", line 363, in _prepare_data
    fields[field] = util.normalize(labels[field], key="amount")
  File "C:\Users\Anshul\InvoiceNet\invoicenet\common\util.py", line 199, in normalize
    text = text.replace(",", '')
AttributeError: 'list' object has no attribute 'replace'

anshulp2912 avatar Aug 09 '20 12:08 anshulp2912

The current model architecture cannot handle multiple entities for a single field. The label for each field is expected to be a single string.

This is definitely a limitation but we are working on addressing the problem of multiple entity extraction for InvoiceNet 2.0. Thank you for pointing this out!

naiveHobo avatar Aug 11 '20 15:08 naiveHobo