Overview


Language enables you to analyze text to extract meta-data from content such as concepts, entities, keywords, categories, sentiment, emotion, relations, semantic roles, using natural language understanding and identify industry/domain specific entities and relations in unstructured text.


Beginner's Guide


Computers are great at working with structured data like spreadsheets and database tables. But us humans usually communicate in words, not in tables. That’s unfortunate for computers.A lot of information in the world is unstructured — raw text in English or another human language. How can we get a computer to understand unstructured text and extract data from it?

NLP is short for natural language processing while NLU is the shorthand for natural language understanding. Similarly named, the concepts both deal with the relationship between natural language (as in, what we as humans speak, not what computers understand) and artificial intelligence.

They share a common goal of making sense of concepts represented in unstructured data, like language, as opposed to structured data like statistics, actions, etc. To that end, NLP and NLU are opposites of a lot of other data mining techniques. But that’s where the comparisons stop: NLU and NLP aren’t the same thing.


Quickstart


Following : 5 services/APIs are provided by Language as part of Release 2.0.0.

  • POS Tagger : Part Of Speech tagging for a piece of text.

  • Sentiment Analysis (English) : Analyses the sentiment of the text and returns if it falls under positive, neutral or negative sentiment.

  • NER Tagger : Named Entity Recognition Tagging for a piece of text.

  • Dependency Parser : Dependency Parser represents the Grammatical Structure of the Sentence.

  • Tags : Tags Extractor for extracting keywords from a paragraph.


APIs


All URIs below are relative to https://studio.spotflock.com

POS Tagger POST   /api/v1/language-service/phoenix-language/nlp/pos/
Sentiment Analysis POST  /api/v1/language-service/phoenix-language/nlp/sentiment/
Named Entity Recognition POST  /api/v1/language-service/phoenix-language/nlp/ner/
Dependency Parser POST  /api/v1/language-service/phoenix-language/nlp/dependency-parser/
Tags POST  /api/v1/language-service/phoenix-language/nlp/tags/

POS Tagger

Description

This API would enable you to do a part of speech tagging of the text.

URI

POST  /api/v1/language-service/phoenix-language/nlp/pos

Headers

api-key Your App's API Key

Attributes

text Text Sentence (String)

Request Example

{
  "text": "He did a terrific job at the construction site"
}

Response

{
  "text": "He did a terrific job at the construction site.",
  "result": {
    "the": "DT",
    "a": "DT",
    "site": "NN",
    "at": "IN",
    "terrific": "JJ",
    "construction": "NN",
    "job": "NN",
    "He": "PRP",
    "did": "VBD"
  }
}

Sentiment Analysis

Description

This API would enable you to do a sentiment analysis and classify if the text is positive,neutral or negative.

URI

POST  /api/v1/language-service/phoenix-language/nlp/sentiment

Headers

api-key Your App's API Key

Attributes

text Text Sentence (String)

Request Example

{
  "text": "He has been always cheerful ever since he moved to Hyderabad."
}

Response

{
    "scores": {
        "neu": 0.741,
        "pos": 0.259,
        "compound": 0.5423,
        "neg": 0
    },
    "text": "He has been always cheerful ever since he moved to Hyderabady",
    "emotion": "POSITIVE",
    "polarity": 3
}

NER Tagger

Description

This API would enable you to do a named entity recognition tagging of the text. This API also finds nearest match for the person detected and gives information such as occupation, nationality of the person.

URI

POST  /api/v1/language-service/phoenix-language/nlp/ner

Headers

api-key Your App's API Key

Attributes

text Text Sentence (String)

Request Example

{
  "text": "Madan Puri bought 300 shares of Acme Corp. in 2006."
}

Response

{
    "result": {
        "300": "CARDINAL",
        "2006": "DATE",
        "Madan Puri": "PERSON",
        "Acme Corp.": "ORG"
    },
    "persons": [
        {
            "Link": "https://en.wikipedia.org/wiki/Madan_Puri",
            "Name": "Madan Puri",
            "Nationality": "Indian",
            "Occupation": "Actor"
        }
    ],
    "text": "Madan Puri bought 300 shares of Acme Corp. in 2006."
}

Dependency Parser

Description

This API would enable you to do dependency-parser

URI

POST  /api/v1/language-service/phoenix-language/nlp/dependency-parser/

Headers

api-key Your App's API Key

Attributes

text Text Sentence (String)

Request Example

{
  "text": "He is a cheerful guy."
}

Response

{
    "cheerful": {
        "children": [],
        "headPOS": "NOUN",
        "dep": "amod",
        "headText": "leader"
    },
    "is": {
        "children": [
            "He",
            "leader",
            "."
        ],
        "headPOS": "VERB",
        "dep": "ROOT",
        "headText": "is"
    },
    "He": {
        "children": [],
        "headPOS": "VERB",
        "dep": "nsubj",
        "headText": "is"
    },
    ".": {
        "children": [],
        "headPOS": "VERB",
        "dep": "punct",
        "headText": "is"
    },
    "a": {
        "children": [],
        "headPOS": "NOUN",
        "dep": "det",
        "headText": "leader"
    },
    "leader": {
        "children": [
            "a",
            "cheerful"
        ],
        "headPOS": "VERB",
        "dep": "attr",
        "headText": "is"
    }
}

Tags Extractor

Description

This API would enable you get tags from a paragraph. Note that

URI

POST  /api/v1/language-service/phoenix-language/nlp/tags/

Headers

api-key Your App's API Key

Attributes

text Text Sentence (String)

Request Example

{
"text": "TweetDeck is a social media dashboard application for management of Twitter accounts. Originally an independent app, TweetDeck was subsequently acquired by Twitter Inc. and integrated into
                Twitter's interface."
}

Response

{
    "tags": [
        "tweetdeck",
        "twitter"
    ],
    "text": "TweetDeck is a social media dashboard application for management of Twitter accounts. Originally an independent app, TweetDeck was subsequently acquired by Twitter Inc. and integrated
                into Twitter's interface."
}

Annotations


NER Supports below entities

Type Description
PERSON People, including fictional.
NORP Nationalities or religious or political groups.
LANGUAGE Any named language.
QUANTITY Measurements, as of weight or distance.
ORDINAL “first”, “second”, etc.
CARDINAL Numerals that do not fall under another type.
MONEY Monetary values, including unit.
PERCENT Percentage, including ”%“.
TIME Times smaller than a day.
DATE Absolute or relative dates or periods.
EVENT Named hurricanes, battles, wars, sports events, etc.
WORK_OF_ART Titles of books, songs, etc.
LAW Named documents made into laws.
LOC Non-GPE locations, mountain ranges, bodies of water.
PRODUCT Objects, vehicles, foods, etc. (Not services.).
FAC Buildings, airports, highways, bridges, etc.
ORG Companies, agencies, institutions, etc.
GPE Countries, cities, states.

Annotations


POS TAGGER Supports below entities

POS Description
PUNCT Punctuations
CD Cardinal Number
SYM Symbol
DT determiner
NN, NNS Noun
NNP, NNPS proper noun
PRP pronoun
UH interjection
JJ, JJR, JJS, WDT Adjective, comparitive and superlative
ADP AdPosition like in, during
VB, VBG, VBN, VBP, VBZ Verb
RB, RBR, RBS Adverb
AUX auxiliary
CC conjunction
CCONJ coordinating conjunction
IN subordinating conjunction

Data Usage FAQ


Apart from the pricing plans for Language where you consume by API calls, you can also use SCUs to consume Language APIs. Below are the SCUs consumed for each service.

APIs SCUs Consumed
POS Tagger 2
Sentiment Analysis 3
NER 2
Dependency Parser 3
Tags 4

Release Notes


Folowing are the release notes as part of Release 2.0.0

  • POS Tagger tags supported are DT, NN, IN, JJ, PRP, VBD etc.,

  • NER Tagger tags supported are PER, ORG, LOC, DATE, GPE, PRODUCT, LANGUAGE, TIME, MONEY, QUANTITY etc.,

  • Sentiment Analysis is supported only in English.

  • Tags Extractor works on paragraphs and minimum frequency of any word to detect as keyword must be atleast two.

  • The Info of the person detected in NER is the nearest match.

Helpdesk