IBM Watson Natural Language Understanding (NLU) API を使用して概念を抽出しています。ほとんどのテキストでは、少なくとも 1 つまたは 2 つの概念を抽出できますが、いくつかの単純なケースでは、概念が返されません。
from watson_developer_cloud import NaturalLanguageUnderstandingV1
from watson_developer_cloud.natural_language_understanding_v1 import Features, CategoriesOptions, ConceptsOptions, RelationsOptions
natural_language_understanding = NaturalLanguageUnderstandingV1( version='2018-11-16', iam_apikey='API-KEY', url='https://gateway.watsonplatform.net/natural-language-understanding/api')
post ="No job Never had any romantic experiences I just have no ability / infrastructure to get through life It's killing me I don't want to be part of this world because I can't fit in, can't compete, can't enjoy Why does it have to be so uncomfortable? I feel so sad on the inside Another night I wonder how it will ever change, will it require my effort completely? I DON'T KNOW WHAT TO FUCKING DO"
response = natural_language_understanding.analyze(
text=post, features=Features(
concepts=ConceptsOptions(limit=10))).get_result()
応答変数に返される結果は次のとおりです。
{'concepts': [], 'language': 'en', 'usage': {'features': 1, 'text_characters': 393, 'text_units': 1}}
私が認識していない API の既知の制限ですか、それとも API の呼び出し方法に問題がありますか?