UNPKG

openapi-directory

Version:

Building & bundling https://github.com/APIs-guru/openapi-directory for easy use from JS

1 lines 15.9 kB
{"openapi":"3.0.0","info":{"contact":{"email":"mlapi@microsoft.com","name":"Microsoft Cognitive Services","url":"https://azure.microsoft.com/en-us/services/cognitive-services/text-analytics/"},"description":"The Text Analytics API is a suite of text analytics web services built with best-in-class Microsoft machine learning algorithms. The API can be used to analyze unstructured text for tasks such as sentiment analysis, key phrase extraction and language detection. No training data is needed to use this API; just bring your text data. This API uses advanced natural language processing techniques to deliver best in class predictions. Further documentation can be found in https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview","title":"Text Analytics Client","version":"v2.1-preview","x-apisguru-categories":["cloud"],"x-logo":{"url":"https://assets.onestore.ms/cdnfiles/onestorerolling-1606-01000/shell/v3/images/logo/microsoft.png"},"x-origin":[{"format":"swagger","url":"https://raw.githubusercontent.com/Azure/azure-rest-api-specs/master/specification/cognitiveservices/data-plane/TextAnalytics/preview/v2.1/TextAnalytics.json","version":"2.0"}],"x-preferred":true,"x-providerName":"azure.com","x-serviceName":"cognitiveservices-TextAnalytics","x-tags":["Azure","Microsoft"]},"security":[{"apim_key":[]}],"paths":{"/entities":{"post":{"deprecated":false,"description":"The API returns a list of recognized entities in a given document. To get even more information on each recognized entity we recommend using the Bing Entity Search API by querying for the recognized entities names. See the <a href=\"https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages\">Supported languages in Text Analytics API</a> for the list of enabled languages.The API returns a list of known entities and general named entities (\"Person\", \"Location\", \"Organization\" etc) in a given document. Known entities are returned with Wikipedia Id and Wikipedia link, and also Bing Id which can be used in Bing Entity Search API. General named entities are returned with entity types. If a general named entity is also a known entity, then all information regarding it (Wikipedia Id, Bing Id, entity type etc) will be returned. See the <a href=\"https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/how-tos/text-analytics-how-to-entity-linking#supported-types-for-named-entity-recognition\">Supported Entity Types in Text Analytics API</a> for the list of supported Entity Types. See the <a href=\"https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/text-analytics-supported-languages\">Supported languages in Text Analytics API</a> for the list of enabled languages.","operationId":"Entities","requestBody":{"$ref":"#/components/requestBodies/MultiLanguageBatchInput"},"responses":{"200":{"description":"A successful call results in a list of recognized entities returned for each valid document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/EntitiesBatchResultV2dot1"},"examples":{"Successful Entities request":{"$ref":"#/components/examples/Successful_Entities_request"}}}}},"default":{"description":"Error Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"The API returns a list of recognized entities in a given document.","tags":["Entities"]}},"/keyPhrases":{"post":{"deprecated":false,"description":"See the <a href=\"https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages\">Text Analytics Documentation</a> for details about the languages that are supported by key phrase extraction.","operationId":"Key Phrases","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MultiLanguageBatchInput"}}},"description":"Collection of documents to analyze. Documents can now contain a language field to indicate the text language","required":true},"responses":{"200":{"description":"A successful response results in 0 or more key phrases identified in each valid document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/KeyPhraseBatchResult"},"examples":{"Successful Key Phrase request":{"$ref":"#/components/examples/Successful_Key_Phrase_request"}}}}},"default":{"description":"Error Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"The API returns a list of strings denoting the key talking points in the input text.","tags":["Key Phrases"]}},"/languages":{"post":{"deprecated":false,"description":"Scores close to 1 indicate 100% certainty that the identified language is true. A total of 120 languages are supported.","operationId":"Detect Language","requestBody":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/BatchInput"}}},"description":"Collection of documents to analyze.","required":true},"responses":{"200":{"description":"A successful call results in the detected language with the highest probability for each valid document","content":{"application/json":{"schema":{"$ref":"#/components/schemas/LanguageBatchResult"},"examples":{"Successful Detect Language request":{"$ref":"#/components/examples/Successful_Detect_Language_request"}}}}},"default":{"description":"Error Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"The API returns the detected language and a numeric score between 0 and 1.","tags":["Detect Language"]}},"/sentiment":{"post":{"deprecated":false,"description":"Scores close to 1 indicate positive sentiment, while scores close to 0 indicate negative sentiment. A score of 0.5 indicates the lack of sentiment (e.g. a factoid statement). See the <a href=\"https://docs.microsoft.com/en-us/azure/cognitive-services/text-analytics/overview#supported-languages\">Text Analytics Documentation</a> for details about the languages that are supported by sentiment analysis.","operationId":"Sentiment","requestBody":{"$ref":"#/components/requestBodies/MultiLanguageBatchInput"},"responses":{"200":{"description":"A successful call results in each valid document getting a sentiment score between 0 and 1","content":{"application/json":{"schema":{"$ref":"#/components/schemas/SentimentBatchResult"},"examples":{"Successful Sentiment request":{"$ref":"#/components/examples/Successful_Sentiment_request"}}}}},"default":{"description":"Error Response","content":{"application/json":{"schema":{"$ref":"#/components/schemas/ErrorResponse"}}}}},"summary":"The API returns a numeric score between 0 and 1.","tags":["Sentiment"]}}},"servers":[{"url":"https://azure.local"},{"url":"{Endpoint}/text/analytics/v2.1-preview","variables":{"Endpoint":{"description":"Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).","x-ms-parameter-location":"client","x-ms-skip-url-encoding":true,"default":"none"}}}],"components":{"examples":{"Successful_Entities_request":{"value":{"documents":[{"entities":[{"bingId":"a093e9b9-90f5-a3d5-c4b8-5855e1b01f85","matches":[{"length":9,"offset":0,"text":"Microsoft"}],"name":"Microsoft","type":"Organization","wikipediaId":"Microsoft","wikipediaLanguage":"en","wikipediaUrl":"https://en.wikipedia.org/wiki/Microsoft"},{"bingId":"5f9fbd03-49c4-39ef-cc95-de83ab897b94","matches":[{"length":10,"offset":19,"text":"Windows 10"}],"name":"Windows 10","wikipediaId":"Windows 10","wikipediaLanguage":"en","wikipediaUrl":"https://en.wikipedia.org/wiki/Windows_10"}],"id":"1"},{"entities":[{"matches":[{"length":4,"offset":3,"text":"1975"}],"name":"1975","subType":"DateRange","type":"DateTime"},{"bingId":"0d47c987-0042-5576-15e8-97af601614fa","matches":[{"length":14,"offset":9,"text":"Bill Gates III"}],"name":"Bill Gates","type":"Person","wikipediaId":"Bill Gates","wikipediaLanguage":"en","wikipediaUrl":"https://en.wikipedia.org/wiki/Bill_Gates"},{"bingId":"df2c4376-9923-6a54-893f-2ee5a5badbc7","matches":[{"length":10,"offset":28,"text":"Paul Allen"}],"name":"Paul Allen","type":"Person","wikipediaId":"Paul Allen","wikipediaLanguage":"en","wikipediaUrl":"https://en.wikipedia.org/wiki/Paul_Allen"}],"id":"2"}],"errors":[]}},"Successful_Key_Phrase_request":{"value":{"documents":[{"id":"1","keyPhrases":["demo"]},{"id":"2","keyPhrases":["Español"]},{"id":"3","keyPhrases":["machine"]},{"id":"4","keyPhrases":["soleil"]}],"errors":[]}},"Successful_Detect_Language_request":{"value":{"documents":[{"detectedLanguages":[{"iso6391Name":"en","name":"English","score":1}],"id":"1"},{"detectedLanguages":[{"iso6391Name":"es","name":"Spanish","score":1}],"id":"2"},{"detectedLanguages":[{"iso6391Name":"en","name":"English","score":1}],"id":"3"},{"detectedLanguages":[{"iso6391Name":"fr","name":"French","score":1}],"id":"4"}],"errors":[]}},"Successful_Sentiment_request":{"value":{"documents":[{"id":"1","score":0.006573081016540527},{"id":"3","score":0.9733303189277649},{"id":"2","score":0.4421966075897217},{"id":"4","score":0.5342581272125244}],"errors":[]}}},"parameters":{"Endpoint":{"description":"Supported Cognitive Services endpoints (protocol and hostname, for example: https://westus.api.cognitive.microsoft.com).","in":"path","name":"Endpoint","required":true,"x-ms-parameter-location":"client","x-ms-skip-url-encoding":true,"schema":{"type":"string"}}},"requestBodies":{"MultiLanguageBatchInput":{"content":{"application/json":{"schema":{"$ref":"#/components/schemas/MultiLanguageBatchInput"}}},"description":"Collection of documents to analyze.","required":true}},"securitySchemes":{"apim_key":{"in":"header","name":"Ocp-Apim-Subscription-Key","type":"apiKey"}},"schemas":{"BatchInput":{"example":{"documents":[{"id":"1","text":"Hello world"},{"id":"2","text":"Bonjour tout le monde"},{"id":"3","text":"La carretera estaba atascada. Había mucho tráfico el día de ayer."},{"id":"4","text":":) :( :D"}]},"properties":{"documents":{"items":{"$ref":"#/components/schemas/Input"},"type":"array"}},"type":"object"},"DetectedLanguage":{"properties":{"iso6391Name":{"description":"A two letter representation of the detected language according to the ISO 639-1 standard (e.g. en, fr).","type":"string"},"name":{"description":"Long name of a detected language (e.g. English, French).","type":"string"},"score":{"description":"A confidence score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true.","format":"double","type":"number"}},"type":"object"},"EntitiesBatchResultItemV2dot1":{"properties":{"entities":{"description":"Recognized entities in the document.","items":{"$ref":"#/components/schemas/EntityRecordV2dot1"},"readOnly":true,"type":"array"},"id":{"description":"Unique document identifier.","readOnly":true,"type":"string"}},"type":"object"},"EntitiesBatchResultV2dot1":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/EntitiesBatchResultItemV2dot1"},"readOnly":true,"type":"array"},"errors":{"items":{"$ref":"#/components/schemas/ErrorRecord"},"readOnly":true,"type":"array"}},"type":"object"},"EntityRecordV2dot1":{"properties":{"bingId":{"description":"Bing unique identifier of the recognized entity. Use in conjunction with the Bing Entity Search API to fetch additional relevant information.","type":"string"},"matches":{"description":"List of instances this entity appears in the text.","items":{"$ref":"#/components/schemas/MatchRecordV2dot1"},"type":"array"},"name":{"description":"Entity formal name.","type":"string"},"subType":{"description":"Entity sub type from Named Entity Recognition model","type":"string"},"type":{"description":"Entity type from Named Entity Recognition model","type":"string"},"wikipediaId":{"description":"Wikipedia unique identifier of the recognized entity.","type":"string"},"wikipediaLanguage":{"description":"Wikipedia language for which the WikipediaId and WikipediaUrl refers to.","type":"string"},"wikipediaUrl":{"description":"URL for the entity's English Wikipedia page.","readOnly":true,"type":"string"}},"type":"object"},"ErrorRecord":{"properties":{"id":{"description":"Input document unique identifier the error refers to.","type":"string"},"message":{"description":"Error message.","type":"string"}},"type":"object"},"ErrorResponse":{"properties":{"code":{"type":"string"},"innerError":{"$ref":"#/components/schemas/InternalError"},"message":{"type":"string"},"target":{"type":"string"}},"type":"object"},"Input":{"properties":{"id":{"description":"Unique, non-empty document identifier.","type":"string"},"text":{"type":"string"}},"type":"object"},"InternalError":{"properties":{"code":{"type":"string"},"innerError":{"$ref":"#/components/schemas/InternalError"},"message":{"type":"string"}},"type":"object"},"KeyPhraseBatchResult":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/KeyPhraseBatchResultItem"},"readOnly":true,"type":"array"},"errors":{"items":{"$ref":"#/components/schemas/ErrorRecord"},"readOnly":true,"type":"array"}},"type":"object"},"KeyPhraseBatchResultItem":{"properties":{"id":{"description":"Unique document identifier.","readOnly":true,"type":"string"},"keyPhrases":{"description":"A list of representative words or phrases. The number of key phrases returned is proportional to the number of words in the input document.","items":{"type":"string"},"readOnly":true,"type":"array"}},"type":"object"},"LanguageBatchResult":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/LanguageBatchResultItem"},"readOnly":true,"type":"array"},"errors":{"items":{"$ref":"#/components/schemas/ErrorRecord"},"readOnly":true,"type":"array"}},"type":"object"},"LanguageBatchResultItem":{"properties":{"detectedLanguages":{"description":"A list of extracted languages.","items":{"$ref":"#/components/schemas/DetectedLanguage"},"readOnly":true,"type":"array"},"id":{"description":"Unique document identifier.","readOnly":true,"type":"string"}},"type":"object"},"MatchRecordV2dot1":{"properties":{"length":{"description":"Length (in Unicode characters) for the entity match text.","format":"int32","type":"integer"},"offset":{"description":"Start position (in Unicode characters) for the entity match text.","format":"int32","type":"integer"},"text":{"description":"Entity text as appears in the request.","type":"string"}},"type":"object"},"MultiLanguageBatchInput":{"example":{"documents":[{"id":"1","language":"en","text":"Hello world. This is some input text that I love."},{"id":"2","language":"fr","text":"Bonjour tout le monde"},{"id":"3","language":"es","text":"La carretera estaba atascada. Había mucho tráfico el día de ayer."}]},"properties":{"documents":{"items":{"$ref":"#/components/schemas/MultiLanguageInput"},"type":"array"}},"type":"object"},"MultiLanguageInput":{"properties":{"id":{"description":"Unique, non-empty document identifier.","type":"string"},"language":{"description":"This is the 2 letter ISO 639-1 representation of a language. For example, use \"en\" for English; \"es\" for Spanish etc.,","type":"string"},"text":{"type":"string"}},"type":"object"},"Object":{"properties":{},"type":"object"},"SentimentBatchResult":{"properties":{"documents":{"items":{"$ref":"#/components/schemas/SentimentBatchResultItem"},"readOnly":true,"type":"array"},"errors":{"items":{"$ref":"#/components/schemas/ErrorRecord"},"readOnly":true,"type":"array"}},"type":"object"},"SentimentBatchResultItem":{"properties":{"id":{"description":"Unique document identifier.","readOnly":true,"type":"string"},"score":{"description":"A decimal number between 0 and 1 denoting the sentiment of the document. A score above 0.7 usually refers to a positive document while a score below 0.3 normally has a negative connotation. Mid values refer to neutral text.","format":"double","readOnly":true,"type":"number"}},"type":"object"}}}}