2017-06-22 9 views
1

,當我進入這個請求:我使用NLU情緒,收到此錯誤:「警告」:「感悟:無法找到的關鍵詞」

{ 
    "text": " 
Il sindaco pensa solo a far realizzare rotonde...non lo disturbate per le cavolate! ,Che schifo! 
", 
    "features": 
    { 
    "sentiment": { 
"targets": [ 
     "aggressione", "aggressioni", "agguati", "agguato", "furto", "furti", "lavoro nero", 
     "omicidi", "omicidio", "rapina", "rapine", "ricettazione", "ricettazioni", "rom", "zingari", "zingaro", 
     "scippo", "scippi", "spaccio", "scommesse" 
     ] 
    }, 
    "categories": {}, 
    "entities": { 
     "emotion": true, 
     "sentiment": true, 
     "limit": 5 
    }, 
    "keywords": { 
     "emotion": true, 
     "sentiment": true, 
     "limit": 5 
    } 
    } 
} 

我得到這樣的迴應:

{ 
    "language": "it", 
    "keywords": [ 
    { 
     "text": ",Che schifo", 
     "relevance": 0.768142 
    } 
    ], 
    "entities": [], 
    "categories": [ 
    { 
     "score": 0.190673, 
     "label": "/law, govt and politics/law enforcement/police" 
    }, 
    { 
     "score": 0.180499, 
     "label": "/style and fashion/clothing/pants" 
    }, 
    { 
     "score": 0.160763, 
     "label": "/society/crime" 
    } 
    ], 
    "warnings": [ 
    "sentiment: cannot locate keyphrase" 
    ] 
} 

爲什麼我沒有收到文檔情緒輸出?如果NLU沒有找到關鍵短語,它會在沒有情緒的情況下給出這個警告!這是一個NLU錯誤來解決?

回答

0

如果NLU沒有找到您傳遞的任何關鍵字,那麼它會拋出警告「找不到關鍵字」。即使文本中存在其中一個目標,它也會返回doc的情緒。 如果您不確定文本中是否存在目標詞組,請針對情感進行單獨的API調用,而不用任何檢索文檔情感的目標。 我不會說它是NLU Side上的一個bug,但是如果服務沒有在給定的文本中找到任何目標短語,服務可以是寬鬆的而不是嚴格的。

相關問題