An API to use Neticle Technologies' semantic and text analysis functions in a standard way.
Version | Release Date | Released by | Description |
---|---|---|---|
v1.0 | 2015.06.21. | Peter Szekeres | Initial internal version |
v1.1 | 2016.07.29. | Zoltan Csikos | input_text can be sent via POST |
v1.2 | 2016.08.15. | Zoltan Csikos | Enabled sending multiple synonyms at the same time for the same text |
Compared to v1.1:
Compared to v1.0:
Doing automated semantic analysis on input text.
http argument | parameter description |
---|---|
lang | the 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. Must be url encoded. (required parameter) |
synonyms | array of 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: - general analysis: skip synonyms altogether from the URL or use: [[]] - analyzing the input_text with one set of synonyms: [["audi", "Audi", "AUDI"]] (same as [„audi”, „Audi”, „AUDI”] in v1.1) - AND logical operator can be set with ; mark: [["Apple;smartphone"]] - phrases can be set with „…”: [["Paramount Channel"]] - sending multiple sets of synonyms: [["audi", "Audi", "AUDI"],["mercedes", "Mercedes", "MERCEDES"]] - general analysis and analysis based on two sets of synonyms: [[],["audi", "Audi", "AUDI"],["mercedes", "Mercedes", "MERCEDES"]] (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) (optional parameter) |
call_id | a special id to help to track calls for different topics Possible values: any string shorter than 255 characters (optional parameter) |
replace_accent | whether to remove letter accents from the input text or not Possible values: 1 - enabled 0 - disabled (default) (optional parameter) |
https://semanticapi.neticle.hu/1.2/text_analysis?lang=hu&token=demokey2&stem=0&input_text=tapasztalataim szerint, ez egy rossz autó&format=json&synonyms=[[],["autó","Autó"]]
{ "input_length": 41, "results": [ { "input_length": 41, "recognized_negative_phrases": [ { "related_pos_phrases": [ ], "phrase": "egy rossz", "mention_number": 1, "related_entities": [ ], "mentions": [ " ez egy rossz autó" ], "related_neg_phrases": [ ] } ], "keyword_stats": { "total_keyword_hit_number": 0, "total_synonym_hit_numbers": [ ] }, "processing_time_in_ms": 100, "recognized_synonyms": [ ], "recognized_positive_phrases": [ ], "html_formatted_text": "<span class=\"contain_keyword\">tapasztalataim szerint<\/span>, <span class=\"contain_keyword\">ez <span class=\"phrase_neg_lvl2 polarity_item\" title=\"-2 \">egy rossz<\/span> autó<\/span>", "opinion_index": -2.0, "call_id": "", "entities": [ { "related_pos_phrases": [ ], "entity_name": "tapasztalat", "entity_opinion_index": 0.0, "mention_number": 1, "related_entities": [ ], "entity_type": "topic", "mentions": [ "tapasztalataim szerint" ], "related_neg_phrases": [ ] } ] }, { "input_length": 41, "recognized_negative_phrases": [ { "related_pos_phrases": [ ], "phrase": "egy rossz", "mention_number": 1, "related_entities": [ ], "mentions": [ " ez egy rossz autó" ], "related_neg_phrases": [ ] } ], "keyword_stats": { "total_keyword_hit_number": 1, "total_synonym_hit_numbers": [ { "autó": 1 } ] }, "processing_time_in_ms": 80, "recognized_synonyms": [ "autó" ], "recognized_positive_phrases": [ ], "html_formatted_text": "tapasztalataim szerint, <span class=\"contain_keyword\">ez <span class=\"phrase_neg_lvl2 polarity_item\" title=\"-2 \">egy rossz<\/span> <span class=\"synonym\">autó<\/span><\/span>", "opinion_index": -2.0, "call_id": "", "entities": [ ] } ], "total_processing_time_in_ms": 181 }
Element | Description |
---|---|
entities | Recognized labels and entities (topics, attributes, brands, locations, etc. (If synonyms are set as parameters, only the labels, entities and phrases related to the target synonyms are recognized. If no synonyms set then every label, entity and phrase is recognized in the text.) |
entity_name | The name of the entity. |
entity_opinion_index | The quantified 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. |
call_id | A special id to help to track calls for different topics |
Error code | Error message |
---|---|
0 | IP address is blacklisted |
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 | Incorrect format value |
10 | Incorrect replace_accent value |
unknown | Unknown exception |
It predicts the gender based on a name String value.
Possible values:
-1 : female
1 : male
0 : unknown
http argument | parameter description |
---|---|
lang | the 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) |
https://semanticapi.neticle.hu/1.0/get_gender_from_name?lang=hu&token=demokey2&name=Lajos&format=json
{ "user_key": "demokey2", "processing_time_in_ms": 400, "gender": 0 }
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 |
It checks the language of the input text.
Possible values:
true
false
http argument | parameter description |
---|---|
lang | the 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) |
https://semanticapi.neticle.hu/1.1/lang_check?lang=hu&token=demokey2&input_text=Lajos egy új autót vett&format=json
{ "user_key": "demokey2", "processing_time_in_ms": 400, "lang": "hu", "lang_check": true }
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 |