MikeHopcroft / ShortOrder

A natural language conversational agent for ordering and organizing items from a catalog.
MIT License
13 stars 7 forks source link

Implement token-flow graph pruning #55

Open MikeHopcroft opened 5 years ago

MikeHopcroft commented 5 years ago

Right now token-flow returns a graph with edges corresponding to each match of each of alias of an entity. For the matches with the same span, we really only want to look at the highest scoring. This change should probably be made in token-flow.

To see an example of an unpruned graph, uncomment the line in targets.ts that produces the following output:

============ Hypothetical target 466:1:\d+ ==============
============ Hypothetical target 2122166:1:\d+ ==============
============ Hypothetical target 2122166:1:\d+ ==============
============ Hypothetical target 466:1:\d+ ==============
============ Hypothetical target 777:1:\d+ ==============
============ Hypothetical target 466:1:\d+ ==============
============ Hypothetical target 466:1:\d+ ==============
============ Hypothetical target 466:\d+:\d+ ==============
============ Hypothetical target 2122166:\d+:\d+ ==============
============ Hypothetical target 2122166:\d+:\d+ ==============
============ Hypothetical target 466:\d+:\d+ ==============