Neticle Wiki

Megmutatjuk mit gondol a Web!

Felhasználói eszközök

Eszközök a webhelyen


semantic_api_v1.0

Ez a dokumentum egy előző változata!


Semantic API v1.0

Description

An API to use Neticle Technologies' semantic and text analysis functions in a standard way.

Version History

Version Description
v1.0 Initial internal version, created by Peter Szekeres on 2015.06.21.

Text Analysis

Description

Doing automated semantic analysis on input text.

  • Entity oriented sentiment analysis: in a text only the phrases, entities and labels related to the set target entity are analyzed. The target is set by it's synonyms, spelling and mispellings.
  • Document level sentiment analysis: in a text every phrases, entities and labels are analyzed. In this case no synonyms are given as input parameter.
  • Attribute recognition: service and product attributes (for example: screen, bandwidth, etc.) are recognized.
  • Topic recognition: key topics (for example: 3G, mobile payment, etc.) are recognized.
  • Location recognition: related locations (for example: Hungary, Pécs, etc.) are recognized.
  • Brand recognition: related brands (for example: Audi, Mercedes, etc.) are recognized.
  • Emotion recognition: related emotions (for example: joy, etc.) are recognized.
  • Person recognition: related persons (for example: Bill Gates, etc.) are recognized.
  • Organization recognition: related organizations (for example: UNICEF, etc.) are recognized.
  • Event recognition: related events (for example: festivals, conferences, etc.) are recognized.
  • Business topic recognition: related business topics (for example: revenue, IPO, etc.) are recognized.
  • Legal topic recognition: related legal topics (for example: lawsuit, legislation, etc.) are recognized.
  • Medical topic recognition: related mediacal topics (for example: receipt, sympton, etc.) are recognized.
  • HR topic recognition: related HR topics (for example: job, salary, etc.) are recognized.

Base URL

Parameters

http argument parameter description
langthe language of the 'input text'.

Possible values:
bg - Bulgarian
de - German
en - English
hu - Hungarian

(required parameter)
token ID of the caller, for example: demokey2

(required parameter)
input_text Raw input text or HTML formatted text to analyze.

(required parameter)
synonyms array of synonyms.

Synonyms are case-sensitive spellings, mispellings, synonyms of the target entity of the sentiment analysis. For example to analyze Audi brand the following synonyms should be set: audi, Audi, AUDI

If synonyms are set, then only the phrases and labels related to the target represented by synonyms will be recognized (aka. entity oriented sentiment analysis): These cars are cool, but I don't like that Audi.

If no synonyms are set, then the full text will be analyzed (aka. document level sentiment analysis). This version should be use only in special cases, because often gives bad results for precise analysis: These cars are cool, but I don't like that Audi.

example value:
- [„audi”, „Audi”, „AUDI”]
- AND logical operator can be set with ; mark: [„Apple;smartphone”]
- phrases can be set also: [„Paramount Channel”]

(optional parameter)
neticle_profile String parameter to set Neticle profile name for specialised lexicons. (This will be used by Neticle system only.)

(optional parameter)
stem whether to include the stemmed format of the original 'input text' within the API response.

Possible values:
1 - enabled
0 - disabled (default)

(optional parameter)
lang_check whether to check that the original 'input text' is aligned with the lang parameter.

Possible values:
1 - enabled
0 - disabled (default)

(optional parameter)
format desired API output format

Possible values:
json (default)
csv

(optional parameter)

Sample call

https://semanticapi.neticle.hu/1.0/text_analysis?lang=hu&token=demokey2&stem=0&input_text=tapasztalataim szerint, ez egy rossz autó&format=json&synonyms=["autó","Autó"]

Sample response

{
    "recognized_negative_phrases": [],
    "entites": [
        {
            "related_pos_phrases": [
                {
                    "name": "egy jó gyors",
                    "related_mention_number": 1
                },
                {
                    "name": "kényelmes",
                    "related_mention_number": 1
                }
            ],
            "related_entites": [
                {
                    "name": "sebesség",
                    "entity_type": "attribute",
                    "related_mention_number": 1
                }
            ],
            "entity_opinion_index": 5,
            "name": "kényelem",
            "mention_number": 1,
            "type": "attribute",
            "mentions": [
                " ez egy jó gyors és kényelmes autó"
            ],
            "related_neg_phrases": []
        },
        {
            "related_pos_phrases": [
                {
                    "name": "egy jó gyors",
                    "related_mention_number": 1
                },
                {
                    "name": "kényelmes",
                    "related_mention_number": 1
                }
            ],
            "related_entites": [
                {
                    "name": "kényelem",
                    "entity_type": "attribute",
                    "related_mention_number": 1
                }
            ],
            "entity_opinion_index": 5,
            "name": "sebesség",
            "mention_number": 1,
            "type": "attribute",
            "mentions": [
                " ez egy jó gyors és kényelmes autó"
            ],
            "related_neg_phrases": []
        }
    ],
    "keyword_stats": {
        "total_keyword_hit_number": 0,
        "total_synonym_hit_numbers": []
    },
    "processing_time_in_ms": 266,
    "recognized_synonyms": [
        ""
    ],
    "recognized_positive_phrases": [
        {
            "related_pos_phrases": [
                {
                    "name": "kényelmes",
                    "related_mention_number": 1
                }
            ],
            "related_entites": [
                {
                    "name": "kényelem",
                    "entity_type": "attribute",
                    "related_mention_number": 1
                },
                {
                    "name": "sebesség",
                    "entity_type": "attribute",
                    "related_mention_number": 1
                }
            ],
            "entity_opinion_index": 5,
            "name": "egy jó gyors",
            "mention_number": 1,
            "type": "pos_phrase",
            "mentions": [
                " ez egy jó gyors és kényelmes autó"
            ],
            "related_neg_phrases": []
        },
        {
            "related_pos_phrases": [
                {
                    "name": "egy jó gyors",
                    "related_mention_number": 1
                }
            ],
            "related_entites": [
                {
                    "name": "kényelem",
                    "entity_type": "attribute",
                    "related_mention_number": 1
                },
                {
                    "name": "sebesség",
                    "entity_type": "attribute",
                    "related_mention_number": 1
                }
            ],
            "entity_opinion_index": 5,
            "name": "kényelmes",
            "mention_number": 1,
            "type": "pos_phrase",
            "mentions": [
                " ez egy jó gyors és kényelmes autó"
            ],
            "related_neg_phrases": []
        }
    ],
    "stemmed_text": "tapasztalat   ez egy jó gyors és kényelmes autó",
    "html_formatted_text": "<span class=\"contain_keyword\">tapasztalataim</span>, <span class=\"contain_keyword\">ez <span class=\"phrase_pos_lvl3 polarity_item\" title=\"3\">egy jó gyors</span> és <span class=\"phrase_pos_lvl2 polarity_item\" title=\"2\">kényelmes</span> autó</span>",
    "opinion_index": 5
}
  

Response explanation

Element Description
entities Recognized labels and entities (topics, attributes, brands, locations, etc.

(If synonyms are set, only the labels related to the synonyms are recognized. If no synonyms set then every label is recognized in the text.)
entity_name The name of the entity.
entity_opinion_index The quantify opinion related to the entity.
entity_type The type of the entity: topic, event, person, brand, attribute, location, etc.
html_formatted_text The HTML and CSS formatted text.

If a sentence part contains a synonym it is surrounded by contain_keyword class span tag.

Recognized phrases are surrounded by polarity_item class span tags.

Recognized synonyms are surrounded by synonym class span tags.
keyword_stats Number of keyword and synonym mentions.
mention_number Number of separate entity mentions.
mentions Relevant sentences of entity mentions.
opinion_index A score that represents how positive or negative is the text. 0 means neutral opinion, while negative value means negative opinion and positive value means positive opinion.
phrase The phrase recognized.
processing_time_in_ms The time needed to process the request.
recognized_negative_phrases Negative phrases recognized in the text.

(If synonyms are set, only the negative phrases related to the synonyms are recognized. If no synonyms set then every negative phrase is recognized in the text.)
recognized_positive_phrases Positive phrases recognized in the text.

(If synonyms are set, only the positive phrases related to the synonyms are recognized. If no synonyms set then every positive phrase is recognized in the text.)
related_neg_phrases Negative phrases related to the entity.
related_mention_number The number of how many times mentioned together with the entity in the same sentence.
related_pos_phrases Positive phrases related to the entity.
recognized_synonyms Synonyms recognized in the text.
total_keyword_hit_number Number of the target entity was mentioned in the input texts. Every synonym hit is counted. If no synonym is set the result is 0.
total_synonym_hit_numbers Number of synonym mentions by each synonym.

Error codes

Error code Error message
1 No lang parameter set
2 Incorrect lang value
3 No token parameter set
4 Incorrect token value
5 Incorrect input_text value
6 Incorrect synonyms value
7 Incorrect stem value
8 Incorrect lang_check value
9 No format parameter set
10 Incorrect format value
unknown Unknown exception

Gender By Name

Description

It predicts the gender based on a name String value.

Possible values:
-1 : female
1 : male
0 : unknown

Base URL

Parameters

http argument parameter description
langthe language of the 'input text'.

Possible values:
bg - Bulgarian
de - German
en - English
hu - Hungarian

(required parameter)
token ID of the caller, for example: demokey2

(required parameter)
name name to analyze

(required parameter)
format desired API output format

Possible values:
json (default)

(optional parameter)

Sample call

https://semanticapi.neticle.hu/1.0/get_gender_from_name?lang=hu&token=demokey2&name=Lajos&format=json

Sample response

{
    "user_key": "demokey2",
    "processing_time_in_ms": 400,
    "gender": 0
}

Error codes

Error code Error message
1 No lang parameter set
2 Incorrect lang value
3 No token parameter set
4 Incorrect token value
5 No name parameter set
6 No format parameter set
7 Incorrect format value
unknown Unknown exception

Language Check

Description

It checks the language of the input text.

Possible values:
true
false

Base URL

Parameters

http argument parameter description
langthe language of the 'input text' to check.

Possible values:
bg - Bulgarian
de - German
en - English
hu - Hungarian

(required parameter)
token ID of the caller, for example: demokey2

(required parameter)
input_text text to analyze

(required parameter)
format desired API output format

Possible values:
json (default)

(optional parameter)

Sample call

https://semanticapi.neticle.hu/1.0/lang_check?lang=hu&token=demokey2&input_text=Lajos egy új autót vett&format=json

Sample response

{
    "user_key": "demokey2",
    "processing_time_in_ms": 400,
    "lang": "hu",
    "lang_check": true
}

Error codes

Error code Error message
1 No lang parameter set
2 Incorrect lang value
3 No token parameter set
4 Incorrect token value
5 No name parameter set
6 No format parameter set
7 Incorrect format value
unknown Unknown exception
semantic_api_v1.0.1434883403.txt.gz · Utolsó módosítás: 2015/06/21 12:43 szerkesztette: szekerespeter