Text Analytics

Detect sentiment, key phrases, named entities and language from your text

Extract information from your text. See it in action!

Use the demo below to experiment with the Text Analytics API. Use our example or provide your own text in the input box below. Identify language, sentiment, key phrases, and entities (preview) in your text.

  1. Analyzed text
  2. JSON
Languages: English (confidence: 100 %)
Key phrases: place, online menu, great menu, marvelous food, midtown NYC, week, dinner party, Contoso Steakhouse, pre-order, John Doe, Sirloin steak, chief cook, owner, kitchen, spot, dining, complaint, email
Sentiment:
Document
MIXED
86%
Positive
0%
Neutral
14%
Negative
Sentence 1
POSITIVE
99%
Positive
1%
Neutral
0%
Negative
Sentence 2
POSITIVE
100%
Positive
0%
Neutral
0%
Negative
Sentence 3
POSITIVE
100%
Positive
0%
Neutral
0%
Negative
Sentence 4
POSITIVE
100%
Positive
0%
Neutral
0%
Negative
Sentence 5
POSITIVE
100%
Positive
0%
Neutral
0%
Negative
Sentence 6
NEUTRAL
0%
Positive
100%
Neutral
0%
Negative
Sentence 7
NEGATIVE
0%
Positive
0%
Neutral
100%
Negative
Sentence 8
POSITIVE
100%
Positive
0%
Neutral
0%
Negative
Named Entities: Contoso Steakhouse [Organization]
Steakhouse [Location]
midtown NYC [Location]
NYC [Location-GPE]
last week [DateTime-DateRange]
dinner party [Event]
chief cook [PersonType]
owner [PersonType]
John Doe [Person]
kitchen [Location]
www.contoso_steakhouse.com [URL]
312-555-0176 [PhoneNumber]
email [Skill]
PII Entities: Type: Organization
Value: Contoso Steakhouse

Type: Person
Value: John Doe

Type: URL
Value: www.contoso_steakhouse.com

Type: PhoneNumber
Value: 312-555-0176

Linked Entities: We went to Contoso Steakhouse located at midtown NYC last week for a dinner party, and we adore the spot! They provide marvelous food and they have a great menu. The chief cook happens to be the owner (I think his name is John Doe) and he is super nice, coming out of the kitchen and greeted us all. We enjoyed very much dining in the place! The Sirloin steak I ordered was tender and juicy, and the place was impeccably clean. You can even pre-order from their online menu at www.contoso_steakhouse.com, call 312-555-0176 or send email to order@contoso_steakhouse.com! The only complaint I have is the food didn't come fast enough. Overall I highly recommend it!
{
  "languageDetection": {
    "documents": [
      {
        "id": "9aedfd13-4b83-4034-852a-07fb974263ec",
        "detectedLanguages": [
          {
            "name": "English",
            "iso6391Name": "en",
            "score": 1.0
          }
        ]
      }
    ],
    "errors": [],
    "modelversion": "2019-10-01"
  },
  "keyPhrases": {
    "documents": [
      {
        "id": "9aedfd13-4b83-4034-852a-07fb974263ec",
        "keyPhrases": [
          "place",
          "online menu",
          "great menu",
          "marvelous food",
          "midtown NYC",
          "week",
          "dinner party",
          "Contoso Steakhouse",
          "pre-order",
          "John Doe",
          "Sirloin steak",
          "chief cook",
          "owner",
          "kitchen",
          "spot",
          "dining",
          "complaint",
          "email"
        ]
      }
    ],
    "errors": [],
    "modelversion": "2019-10-01"
  },
  "sentiment": {
    "documents": [
      {
        "id": "9aedfd13-4b83-4034-852a-07fb974263ec",
        "sentiment": "mixed",
        "documentscores": {
          "positive": 0.86,
          "neutral": 0.0,
          "negative": 0.14
        },
        "sentences": [
          {
            "sentiment": "positive",
            "sentencescores": {
              "positive": 0.99,
              "neutral": 0.01,
              "negative": 0.0
            },
            "offset": 0,
            "length": 105
          },
          {
            "sentiment": "positive",
            "sentencescores": {
              "positive": 1.0,
              "neutral": 0.0,
              "negative": 0.0
            },
            "offset": 106,
            "length": 55
          },
          {
            "sentiment": "positive",
            "sentencescores": {
              "positive": 1.0,
              "neutral": 0.0,
              "negative": 0.0
            },
            "offset": 162,
            "length": 137
          },
          {
            "sentiment": "positive",
            "sentencescores": {
              "positive": 1.0,
              "neutral": 0.0,
              "negative": 0.0
            },
            "offset": 300,
            "length": 41
          },
          {
            "sentiment": "positive",
            "sentencescores": {
              "positive": 1.0,
              "neutral": 0.0,
              "negative": 0.0
            },
            "offset": 342,
            "length": 85
          },
          {
            "sentiment": "neutral",
            "sentencescores": {
              "positive": 0.0,
              "neutral": 1.0,
              "negative": 0.0
            },
            "offset": 428,
            "length": 141
          },
          {
            "sentiment": "negative",
            "sentencescores": {
              "positive": 0.0,
              "neutral": 0.0,
              "negative": 1.0
            },
            "offset": 570,
            "length": 62
          },
          {
            "sentiment": "positive",
            "sentencescores": {
              "positive": 1.0,
              "neutral": 0.0,
              "negative": 0.0
            },
            "offset": 633,
            "length": 30
          }
        ]
      }
    ],
    "errors": [],
    "modelversion": "2019-10-01"
  },
  "entities": {
    "documents": [
      {
        "id": "9aedfd13-4b83-4034-852a-07fb974263ec",
        "entities": [
          {
            "text": "Contoso Steakhouse",
            "type": "Organization",
            "subtype": null,
            "offset": 11,
            "length": 18,
            "score": 0.65
          },
          {
            "text": "Steakhouse",
            "type": "Location",
            "subtype": null,
            "offset": 19,
            "length": 10,
            "score": 0.33
          },
          {
            "text": "midtown NYC",
            "type": "Location",
            "subtype": null,
            "offset": 41,
            "length": 11,
            "score": 0.56
          },
          {
            "text": "NYC",
            "type": "Location",
            "subtype": "GPE",
            "offset": 49,
            "length": 3,
            "score": 0.9
          },
          {
            "text": "last week",
            "type": "DateTime",
            "subtype": "DateRange",
            "offset": 53,
            "length": 9,
            "score": 0.8
          },
          {
            "text": "dinner party",
            "type": "Event",
            "subtype": null,
            "offset": 69,
            "length": 12,
            "score": 0.52
          },
          {
            "text": "chief cook",
            "type": "PersonType",
            "subtype": null,
            "offset": 166,
            "length": 10,
            "score": 0.72
          },
          {
            "text": "owner",
            "type": "PersonType",
            "subtype": null,
            "offset": 195,
            "length": 5,
            "score": 0.78
          },
          {
            "text": "John Doe",
            "type": "Person",
            "subtype": null,
            "offset": 222,
            "length": 8,
            "score": 0.84
          },
          {
            "text": "kitchen",
            "type": "Location",
            "subtype": null,
            "offset": 272,
            "length": 7,
            "score": 0.68
          },
          {
            "text": "www.contoso_steakhouse.com",
            "type": "URL",
            "subtype": null,
            "offset": 477,
            "length": 26,
            "score": 0.8
          },
          {
            "text": "312-555-0176",
            "type": "PhoneNumber",
            "subtype": null,
            "offset": 510,
            "length": 12,
            "score": 0.8
          },
          {
            "text": "email",
            "type": "Skill",
            "subtype": null,
            "offset": 531,
            "length": 5,
            "score": 0.8
          }
        ]
      }
    ],
    "errors": [],
    "modelversion": "2020-02-01"
  },
  "entityLinking": {
    "documents": [
      {
        "id": "9aedfd13-4b83-4034-852a-07fb974263ec",
        "entities": [
          {
            "name": "Sirloin steak",
            "matches": [
              {
                "text": "Sirloin steak",
                "offset": 346,
                "length": 13,
                "score": 0.587581248582304
              }
            ],
            "language": "en",
            "id": "Sirloin steak",
            "url": "https://en.wikipedia.org/wiki/Sirloin_steak",
            "datasource": "Wikipedia"
          },
          {
            "name": "Steakhouse",
            "matches": [
              {
                "text": "Steakhouse",
                "offset": 19,
                "length": 10,
                "score": 0.690180109345877
              }
            ],
            "language": "en",
            "id": "Steakhouse",
            "url": "https://en.wikipedia.org/wiki/Steakhouse",
            "datasource": "Wikipedia"
          },
          {
            "name": "John Doe",
            "matches": [
              {
                "text": "John Doe",
                "offset": 222,
                "length": 8,
                "score": 0.0014322986345076671
              }
            ],
            "language": "en",
            "id": "John Doe",
            "url": "https://en.wikipedia.org/wiki/John_Doe",
            "datasource": "Wikipedia"
          },
          {
            "name": "Contoso",
            "matches": [
              {
                "text": "Contoso",
                "offset": 11,
                "length": 7,
                "score": 0.60043485187820367
              }
            ],
            "language": "en",
            "id": "Contoso",
            "url": "https://en.wikipedia.org/wiki/Contoso",
            "datasource": "Wikipedia"
          },
          {
            "name": "New York City",
            "matches": [
              {
                "text": "NYC",
                "offset": 49,
                "length": 3,
                "score": 0.33013566281980689
              }
            ],
            "language": "en",
            "id": "New York City",
            "url": "https://en.wikipedia.org/wiki/New_York_City",
            "datasource": "Wikipedia"
          }
        ]
      }
    ],
    "errors": [],
    "modelversion": "2020-02-01"
  },
  "entityPII": {
    "documents": [
      {
        "id": "9aedfd13-4b83-4034-852a-07fb974263ec",
        "entities": [
          {
            "text": "Contoso Steakhouse",
            "type": "Organization",
            "subtype": null,
            "offset": 11,
            "length": "18",
            "score": 0.65
          },
          {
            "text": "John Doe",
            "type": "Person",
            "subtype": null,
            "offset": 222,
            "length": "8",
            "score": 0.84
          },
          {
            "text": "www.contoso_steakhouse.com",
            "type": "URL",
            "subtype": null,
            "offset": 477,
            "length": "26",
            "score": 0.8
          },
          {
            "text": "312-555-0176",
            "type": "PhoneNumber",
            "subtype": null,
            "offset": 510,
            "length": "12",
            "score": 0.8
          }
        ]
      }
    ],
    "errors": [],
    "modelversion": "2020-02-01"
  }
}

Sentiment analysis

The API returns a numeric score between 0 and 1. Scores close to 1 indicate positive sentiment, and scores close to 0 indicate negative sentiment. Sentiment score is generated using classification techniques. The input features of the classifier include n-grams, features generated from part-of-speech tags, and word embeddings. It is supported in a variety of languages.

Learn more

Key phrase extraction

The API returns a list of strings denoting the key talking points in the input text. We employ techniques from Microsoft Office's sophisticated Natural Language Processing toolkit. English, German, Spanish, and Japanese text are supported.

Learn more

Language detection

The API returns the detected language and a numeric score between 0 and 1. Scores close to 1 indicate 100% certainty that the identified language is true. A total of 120 languages are supported.

Learn more

Named Entity Recognition

Detect all named entities in the text, such as organizations, people, and locations, and more. Entity Linking disambiguates distinct entities by associating text to additional information on the web. For example, use it to determine whether a term such as “times” refers to “The New York Times” or “Times Square.”

Learn more

Prism Skylabs

"We found Cognitive Services to be the missing piece in the equation, the one that we needed to bring this solution to market and really revolutionize the way people look at video."

Katie McCann: Vice President of Product and Engineering | Prism Skylabs

Explore the Cognitive Services APIs

Computer Vision

Distill actionable information from images

Face

Detect, identify, analyze, organize, and tag faces in photos

Ink Recognizer

An AI service that recognizes digital ink content, such as handwriting, shapes, and ink document layout

Video Indexer

Unlock video insights

Custom Vision

Easily customize your own state-of-the-art computer vision models for your unique use case

Form Recognizer

The AI-powered document extraction service that understands your forms

Text Analytics

Easily evaluate sentiment and topics to understand what users want

Translator Text

Easily conduct machine translation with a simple REST API call

QnA Maker

Distill information into conversational, easy-to-navigate answers

Language Understanding

Teach your apps to understand commands from your users

Immersive Reader

Empower users of all ages and abilities to read and comprehend text

Speech Services

Unified speech services for speech-to-text, text-to-speech and speech translation

Speaker Recognition

Use speech to identify and verify individual speakers

Speech Translation

Easily integrate real-time speech translation to your app

Speech to Text

Convert spoken audio to text for more natural interactions

Text to Speech

Convert text to speech to create more natural, accessible interfaces

Content Moderator

Automated image, text, and video moderation

Anomaly Detector

Easily add anomaly detection capabilities to your apps.

Personalizer

An AI service that delivers a personalized user experience

Ready to supercharge your app?