Logo
    立即注册
    实体情感
    最近更新时间:2022-12-19 12:03:19

    简介

    实体情感算法批量调用接口

    调用示例

    curl -i -XPOST -H 'Content-Type: application/json' \
    -H 'Authorization: your token here' \
    -d'{"documents":[{"id":"your id","data":{"Text":"苹果手机真好用","Keywords":"苹果手机"}}]}' \
    https://open.datastory.com.cn/api/thanos/snt

    说明:

    • Text:文本数据
    • Keywords:实体。实体可以以关键词列表或NER结果的方式输入 关键词列表中,不同实体用^分割,同一实体的不同称呼用|分割(不分大小写),若实体会有不同称呼,则会用第一个出现的作为输出,如:
      "Keywords":"周杰伦|杰伦|jay^尔康"

      亦可填入Ner结果,新概念识别、商体识别、通用实体识别的结果或其他符合NER高级版格式的输入均可,如:

      "Keywords":"{\"人名":{\"周杰伦":{\"index\":[3,12],\"originName\":["杰伦","杰伦"]},\"尔康\":{\"index\":[9]}}}\"}}
    • token请联系算法组同事提供

    请求响应

    若输入格式为原文+关键词列表:

    [{"results":{"ENTITY_SNT_PRO":{"人名":{"周杰伦":{"index":[3,12],"originName":["杰伦","杰伦"],"sentiment":["正面","正面"],"sentimentProbability":[0.99,0.98],"overallSentiment":["正面"],"overallSentimentProbability":[0.99]},"尔康":{"index":[9],"sentiment":["负面"],"sentimentProbability":[0.99],"overallSentiment":["负面"],"overallSentimentProbability":[0.88]}}}}}]

    若输入格式为原文+NER结果

    [{"results":{"ENTITY_SNT_PRO":{"人名":{"周杰伦":{"index":[3,12],"originName":["杰伦","杰伦"],"sentiment":["正面","正面"],"sentimentProbability":[0.99,0.98],"overallSentiment":["正面"],"overallSentimentProbability":[0.99]},"尔康":{"index":[9],"sentiment":["负面"],"sentimentProbability":[0.99],"overallSentiment":["负面"],"overallSentimentProbability":[0.88]}}}}}]

    微信扫描二维码在线咨询