facebook / duckling

Language, engine, and tooling for expressing, testing, and evaluating composable language rules on input strings.
Other
4.05k stars 723 forks source link

overalaping body in the extracted entities #740

Open vivek2259 opened 1 month ago

vivek2259 commented 1 month ago

How can we make sure that there are no overlapping bodies in the extracted entities.

For example: for text: "one hundred forty one hundred and thirteen". I wanted the output: 140 and 113 ultimately

but I got 141 and 4113 (forty one is common between both the bodies).

[{'body': 'one hundred forty one',
  'start': 0,
  'value': {'value': 141, 'type': 'value'},
  'end': 21,
  'dim': 'number',
  'latent': False},
 {'body': 'forty one hundred and thirteen',
  'start': 12,
  'value': {'value': 4113, 'type': 'value'},
  'end': 42,
  'dim': 'number',
  'latent': False}]

I want nothing to overlap between the bodies of the extracted entities.