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
The span outputs of results with detection models are incorrect.
Sample Code
curl -v -H "Content-Type: application/json" --request POST \
--data '{"model_id": "model_name",
"inputs": "There was once a really dumb cat. The chicken crossed the road. The social security number is 123-45-6789. His phone number is (408) 123-4567. ",
"guardrail_config": {
"input": {
"models": {"detector_name": {"threshold": 0.5}
}
},
"output": {"models":{}}
},
"text_gen_parameters": {
"min_new_tokens": 40,
"max_new_tokens": 200
}
}' \
http://localhost:8081/api/v1/task/classification-with-text-generation
Expected behavior
Span starts and ends should correctly indicate text positions
Observed behavior
Spans all start with 0 in results
{"token_classification_results":{"input":[{"start":0,"end":42,"word":"The social security number is 123-45-6789.","entity":"has_HAP","entity_group":"hap","score":0.00021640431077685207},{"start":0,"end":33,"word":"There was once a really dumb cat.","entity":"has_HAP","entity_group":"thing","score":0.9265003204345704},{"start":0,"end":35,"word":"His phone number is (408) 123-4567.","entity":"has_thing","entity_group":"hap","score":0.0003851974615827203},{"start":0,"end":29,"word":"The chicken crossed the road.","entity":"has_thing","entity_group":"thing","score":0.0013679045950993896}]},"input_token_count":35,"warnings":[{"id":"UNSUITABLE_INPUT","message":"Unsuitable input detected. Please check the detected entities on your input and try again with the unsuitable input removed."}]}
The text was updated successfully, but these errors were encountered:
Describe the bug
The span outputs of results with detection models are incorrect.
Sample Code
Expected behavior
Span starts and ends should correctly indicate text positions
Observed behavior
Spans all start with 0 in results
The text was updated successfully, but these errors were encountered: