## Relation Prediction 输入一组{sent, rel}句子关系对,判断每个句子是否属于对应的关系,分值越接近于1表示可能性越大。 1. 如果格式不正确,没有“sents",则返回{"error": "xxx"} 2. 每个句子关系对中,若对应的关系rel没有分类模型,则返回-1;若不存在sent或者rel,则直接跳过; ``` $ http --verbose POST http://localhost:5000/predict <<< '{"sents": [ {"sent": "hello", "rel": "negative_mood"}, {"sent": "hello", "rel": "something_where"}]}' POST /predict HTTP/1.1 Accept: application/json Accept-Encoding: gzip, deflate Connection: keep-alive Content-Length: 110 Content-Type: application/json Host: localhost:5000 User-Agent: HTTPie/0.9.2 { "sents": [ { "rel": "negative_mood", "sent": "hello" }, { "rel": "something_where", "sent": "hello" } ] } HTTP/1.1 200 OK Connection: close Date: Tue, 07 Apr 2020 02:51:53 GMT Server: gunicorn/20.0.4 content-length: 145 content-type: application/json { "result": [ { "rel": "negative_mood", "score": "0.26477456", "sent": "hello" }, { "rel": "something_where", "score": "0.6543278", "sent": "hello" } ] } ```