Is there a way to return matched keywords from invoice2data library in python?

25 Views Asked by At

Below is content my .yml file

fields:
  order_dt: Order Date\s+:\s*\s(\d{1,2}\/\d{1,2}\/\d{4})
  static_ent_code: 11003722901
  static_ent_name: AJIT MEDICALS
  static_ent_type: C
issuer: AJIT MEDICALS
keywords:
- AJIT MEDICALS
- TEJAS
options:
  remove_whitespace: false
required_fields:
- order_dt

The above template gets matched and return the below extracted data

{'issuer': 'AJIT MEDICALS', 'order_dt': '', 'ent_code': 11003722901, 'ent_name': 'AJIT MEDICALS', 'ent_type': 'C', 'currency': 'EUR', 'desc': 'Invoice from AJIT MEDICALS'}

I am expecting the extracted data to include the keywords as well. Example Output should look like

 {'issuer': 'AJIT MEDICALS', 'order_dt': '', 'ent_code': 11003722901, 'ent_name': 'AJIT MEDICALS', 'ent_type': 'C', 'currency': 'EUR', 'desc': 'Invoice from AJIT MEDICALS', 'keyword1': 'AJIT MEDICALS', 'keyword2': 'TEJAS'}
0

There are 0 best solutions below