You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Changed API of Key Value Extraction task to use Dict and not List[Tuple] (NON BACKWARD COMPATIBLE CHANGE) (#1675)
* Moved key value extraction task and metrics to use Dict[str,str] to compare and not List[Tuple[str,str]]
Also created a dedicated metric.
Signed-off-by: Yoav Katz <[email protected]>
* Updated metric to better address in case keys are used in prediction and not references
Signed-off-by: Yoav Katz <[email protected]>
* Added ability to customize inner metric used to compare each entity in KeyValueExtraction
Signed-off-by: Yoav Katz <[email protected]>
* Fixed unitest and bug with handling nones
Signed-off-by: Yoav Katz <[email protected]>
* Fixed KeyValueExtraction prepare
Signed-off-by: Yoav Katz <[email protected]>
* Added example of multiple metrics
Signed-off-by: Yoav Katz <[email protected]>
* Fix catalog
Signed-off-by: Yoav Katz <[email protected]>
* Fix some bugs in inference engine tests
Signed-off-by: elronbandel <[email protected]>
* Fix some bugs in inference engine tests
Signed-off-by: elronbandel <[email protected]>
* Updated key value extraction metric names
Signed-off-by: Yoav Katz <[email protected]>
* Updated key value extraction metric names
Signed-off-by: Yoav Katz <[email protected]>
* Updated documentation string
Signed-off-by: Yoav Katz <[email protected]>
* Fixed unit test.
* Updated to use metric as artifact and not string
* Fix bug in name conversion in rits
Signed-off-by: elronbandel <[email protected]>
* Add engine id
Signed-off-by: elronbandel <[email protected]>
* Improved output message when using inference cache
Also fixed issue when all data was in the cache and an empty list was passed to _infer.
Signed-off-by: Yoav Katz <[email protected]>
* Fixed bug due to indentation change
Signed-off-by: Yoav Katz <[email protected]>
* fix
Signed-off-by: elronbandel <[email protected]>
* fix
Signed-off-by: elronbandel <[email protected]>
* Removed warning of legacy name.
Signed-off-by: Yoav Katz <[email protected]>
* Use greedy decoding and remove redundant cache
Signed-off-by: elronbandel <[email protected]>
* Merge branch 'improve_inference_log' into entity_squad_metric
* Ensure temperature is 0 in extraction task
* Removed unneeded changes from past merge
---------
Signed-off-by: Yoav Katz <[email protected]>
Signed-off-by: elronbandel <[email protected]>
Co-authored-by: elronbandel <[email protected]>
Copy file name to clipboardexpand all lines: prepare/tasks/key_value_extraction.py
+3-3
Original file line number
Diff line number
Diff line change
@@ -1,4 +1,4 @@
1
-
fromtypingimportAny, Dict, List, Tuple
1
+
fromtypingimportAny, Dict, List
2
2
3
3
fromunitxt.blocksimportTask
4
4
fromunitxt.catalogimportadd_to_catalog
@@ -8,8 +8,8 @@
8
8
__description__="This is a key value extraction task, where a specific list of possible 'keys' need to be extracted from the input. The ground truth is provided key-value pairs in the form of the dictionary. The results are evaluating using F1 score metric, that expects the predictions to be converted into a list of (key,value) pairs. ",
"__description__": "Metric that evaluates key value pairs predictions (provided as dictionaries)\nwith reference key value pairs (also provided as dictionaries). By default uses an accuracy (exact match) between each for the fields.\nReports average accuracy for each key , as well as micro and macro averages across all keys.\n",
"__description__": "Metric that evaluates key value pairs predictions (provided as dictionary)\nwith reference key value pairs (also provided as dictionary).\nCalculates token overlap between values of corresponding value in reference and prediction.\nReports f1 per key, micro f1 averages across all key/value pairs, and macro f1 averages across keys.\n",
0 commit comments