nlpapiv2
cloudmersive-nlp-api-client的Python项目详细描述
cloudmersive_nlp_api_客户端
强大的自然语言处理API(v2)允许您执行词性标记、实体识别、句子分析等,以帮助您理解非结构化文本的含义。在
这个Python包为Cloudmersive NLP提供了一个本机API客户机
- API版本:v1
- 包版本:4.0.1
- 生成包:io.swagger.codegen.语言.PythonClientCodegen在
要求
Python 2.7和3.4+
安装和使用
pip安装
如果python包托管在Github上,则可以直接从Github安装
pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
(您可能需要使用根权限运行pip
:sudo pip install git+https://github.com/GIT_USER_ID/GIT_REPO_ID.git
)
然后导入包:
^{pr2}$设置工具
通过Setuptools安装。在
python setup.py install --user
(或sudo python setup.py install
为所有用户安装软件包)
然后导入包:
importcloudmersive_nlp_api_client
入门
请按照installation procedure操作,然后运行以下命令:
from__future__importprint_functionimporttimeimportcloudmersive_nlp_api_clientfromcloudmersive_nlp_api_client.restimportApiExceptionfrompprintimportpprint# Configure API key authorization: Apikeyconfiguration=cloudmersive_nlp_api_client.Configuration()configuration.api_key['Apikey']='YOUR_API_KEY'# Uncomment below to setup prefix (e.g. Bearer) for API key, if needed# configuration.api_key_prefix['Apikey'] = 'Bearer'# create an instance of the API classapi_instance=cloudmersive_nlp_api_client.AnalyticsApi(cloudmersive_nlp_api_client.ApiClient(configuration))input=cloudmersive_nlp_api_client.HateSpeechAnalysisRequest()# HateSpeechAnalysisRequest | Input hate speech analysis requesttry:# Perform Hate Speech Analysis and Detection on Textapi_response=api_instance.analytics_hate_speech(input)pprint(api_response)exceptApiExceptionase:print("Exception when calling AnalyticsApi->analytics_hate_speech: %s\n"%e)
API终结点文档
所有uri都是相对于https://api.cloudmersive.com
Class | Method | HTTP request | Description |
---|---|---|---|
AnalyticsApi | analytics_hate_speech | POST /nlp-v2/analytics/hate-speech | Perform Hate Speech Analysis and Detection on Text |
AnalyticsApi | analytics_profanity | POST /nlp-v2/analytics/profanity | Perform Profanity and Obscene Language Analysis and Detection on Text |
AnalyticsApi | analytics_sentiment | POST /nlp-v2/analytics/sentiment | Perform Sentiment Analysis and Classification on Text |
AnalyticsApi | analytics_similarity | POST /nlp-v2/analytics/similarity | Perform Semantic Similarity Comparison of Two Strings |
AnalyticsApi | analytics_subjectivity | POST /nlp-v2/analytics/subjectivity | Perform Subjectivity and Objectivity Analysis on Text |
ExtractEntitiesApi | extract_entities_post | POST /nlp-v2/extract-entities | Extract entities from string |
LanguageDetectionApi | language_detection_get_language | POST /nlp-v2/language/detect | Detect language of text |
LanguageTranslationApi | language_translation_translate_deu_to_eng | POST /nlp-v2/translate/language/deu/to/eng | Translate German to English text with Deep Learning AI |
LanguageTranslationApi | language_translation_translate_eng_to_deu | POST /nlp-v2/translate/language/eng/to/deu | Translate English to German text with Deep Learning AI |
LanguageTranslationApi | language_translation_translate_eng_to_fra | POST /nlp-v2/translate/language/eng/to/fra | Translate English to French text with Deep Learning AI |
LanguageTranslationApi | language_translation_translate_eng_to_rus | POST /nlp-v2/translate/language/eng/to/rus | Translate English to Russian text with Deep Learning AI |
LanguageTranslationApi | language_translation_translate_fra_to_eng | POST /nlp-v2/translate/language/fra/to/eng | Translate French to English text with Deep Learning AI |
LanguageTranslationApi | language_translation_translate_rus_to_eng | POST /nlp-v2/translate/language/rus/to/eng | Translate Russian to English text with Deep Learning AI |
ParseApi | parse_parse_string | POST /nlp-v2/parse/tree | Parse string to syntax tree |
PosTaggerApi | pos_tagger_tag_adjectives | POST /nlp-v2/pos/tag/adjectives | Part-of-speech tag a string, filter to adjectives |
PosTaggerApi | pos_tagger_tag_adverbs | POST /nlp-v2/pos/tag/adverbs | Part-of-speech tag a string, filter to adverbs |
PosTaggerApi | pos_tagger_tag_nouns | POST /nlp-v2/pos/tag/nouns | Part-of-speech tag a string, filter to nouns |
PosTaggerApi | pos_tagger_tag_pronouns | POST /nlp-v2/pos/tag/pronouns | Part-of-speech tag a string, filter to pronouns |
PosTaggerApi | pos_tagger_tag_sentence | POST /nlp-v2/pos/tag/sentence | Part-of-speech tag a string |
PosTaggerApi | pos_tagger_tag_verbs | POST /nlp-v2/pos/tag/verbs | Part-of-speech tag a string, filter to verbs |
RephraseApi | rephrase_english_rephrase_sentence_by_sentence | POST /nlp-v2/rephrase/rephrase/eng/by-sentence | Rephrase, paraphrase English text sentence-by-sentence using Deep Learning AI |
SegmentationApi | segmentation_get_sentences | POST /nlp-v2/segmentation/sentences | Extract sentences from string |
SegmentationApi | segmentation_get_words | POST /nlp-v2/segmentation/words | Get words in input string |
SpellcheckApi | spellcheck_check_sentence | POST /nlp-v2/spellcheck/check/sentence | Check if sentence is spelled correctly |
SpellcheckApi | spellcheck_correct_json | POST /nlp-v2/spellcheck/check/word | Find spelling corrections |
模型文档
- CheckSentenceRequest
- CheckSentenceResponse
- CheckWordRequest
- CheckWordResponse
- CorrectWordInSentence
- Entity
- ExtractEntitiesRequest
- ExtractEntitiesResponse
- GetWordsRequest
- GetWordsResponse
- HateSpeechAnalysisRequest
- HateSpeechAnalysisResponse
- LanguageDetectionRequest
- LanguageDetectionResponse
- LanguageTranslationRequest
- LanguageTranslationResponse
- ParseRequest
- ParseResponse
- PosRequest
- PosResponse
- PosSentence
- PosTaggedWord
- ProfanityAnalysisRequest
- ProfanityAnalysisResponse
- RephraseRequest
- RephraseResponse
- RephrasedSentence
- RephrasedSentenceOption
- SentenceSegmentationRequest
- SentenceSegmentationResponse
- SentimentAnalysisRequest
- SentimentAnalysisResponse
- SimilarityAnalysisRequest
- SimilarityAnalysisResponse
- SubjectivityAnalysisRequest
- SubjectivityAnalysisResponse
- WordPosition
授权文件
阿皮基
- ^{str>$key}1类型
- API key参数名:Apikey
- Location:HTTP头
作者
- 项目
标签: