Ru En

The Linguistic API (Cloud Service) for Chatbot Developers and Linguists

 

EnduranceRobots.com

ParaPhraser.ru

logo new brand.jpg

gf@EnduranceRobots.com

+ 7 916 225 4302

Skype: George.fomitchev

 

The Linguistic API (Cloud Service) for Chatbot Developers and Linguists 

EnduranceRobots.com together with ParaPhraser.ru offer a universal REST API open for everybody:

  • Chatbot developers.

  • Web-masters.

  • Advertisers.

  • Copywriters.

  • Linguists.

 

Alfa version is free and open for everybody (License MIT).

 

Похожее изображение

Картинки по запросу api

 

 

 

The API Functions

Word and Phrase Embeddings

Status: Active

Returns a list of words or phrases similar to the original word or phrase on the basis of the distributive semantic model. 

Description

The function accepts a phrase or a word for the input, performs its morphological analysis, removes ambiguity at the level of the parts of speech, and returns a list of phrases or words that are semantically close to the original phrase or word, based on the Word2Vec technology. The initial form and part of speech of the original word in the Universal POS tags format are also returned (in the case of phrases, this information is returned for each word inside the original phrase).

If an input word is ambiguous, the answer is given for each possible part of speech of that word separately. In addition, the output words are in the same form as the words in the original query.

If an input word is not found in the vector model, the function returns only the initial form and part of speech. Some auxiliary parts of speech (articles, auxiliary verbs), as well as punctuation marks and other symbols are treated in the similar way - the function returns only the initial form and part of speech.

The function is basic for the given API.

Parameters

Parameter

Description

query

the search word or phrase (a string, not more than 90 characters)

top

the number of returned words and phrases (not more than 30)

lang

language («ru» or «en»)

format

output format (must equal «json»)

token

the unique user’s key

Examples

Request Example

https://www.paraphraser.ru/api?c=vector&query=rainy day&top=3&lang=en&format=json&token=485…64

Response Example

{

    "code": 0,

    "response": {

        "1": {

            "original": "rainy day",

            "vector": [

                "muggy month",

                "windless month",

                "windless week", 

            ],

            "lemma": "rainy day",

            "pos": "ADJ NOUN"

        }

    },

    "msg": "OK"

}

Note

The set of input parameters of this function can be expanded to obtain semantic similarity coefficients and word forms.

Semantic Similarity Coefficients 

Status: Active

Returns the coefficient of semantic similarity between the output and the original word or phrase for each phrase or word in the output vector of close words.

Description

The function expands word and phrase embeddings, providing it with the semantic similarity indexes (relative to the original word or phrase). The index values can be from 0 to 1.

Parameters

In addition to the basic parameters of the function of obtaining similar words (phrases), it is necessary to specify the following parameters:

Parameter

Description

scores

to return the semantic similarity coefficients (the number should equal “1”).

Examples

Request Example

https://www.paraphraser.ru/api?c=vector&query=rainy day&top=3&scores=1&lang=en&format=json&token=485…64

Response Example

{

    "code": 0,

    "response": {

        "1": {

            "original": "rainy day",

            "vector": [

                [

                    "muggy month",

                    0.755

                ],

                [

                    "windless month",

                    0.7492

                ],

                [

                    "windless week",

                    0.7437

                ]

            ],

            "lemma": "rainy day",

            "pos": "ADJ NOUN"

        }

    },

    "msg": "OK"

}

Note

This function can be called together with the function of word forms. 

Word Forms

Status: Active

Returns all the word forms of the words from the vector for the given word (phrase).  

Description

The function expands word and phrase embeddings, returning all the possible forms of the original word (or words inside the original phrase), as well as all the possible word forms for the resulting vector of words/phrases.

Parameters

In addition to the basic parameters of the word and phrase embeddings function, it is necessary to specify the following parameters:

Parameter

Description

forms

to return all the word forms (the number should take the value «1»).

Examples

Request Example

https://www.paraphraser.ru/api?c=vector&query=rainy day&top=3&forms=1&lang=en&format=json&token=485…64

Response Example

{

    "code": 0,

    "msg": "OK",

    "response": {

        "1": {

            "pos": "ADJ NOUN",

            "lemma": "rainy day",

            "forms_query": {

                "rainy": [

                    "rainy",

                    "rainier",

                    "rainiest"

                ],

                "day": [

                    "day",

                    "days"

                ]

            },

            "original": "rainy day",

            "forms": [

                {

                    "muggy": [

                        "muggy",

                        "muggier",

                        "muggiest"

                    ],

                    "month": [

                        "month",

                        "months"

                    ]

                },

                {

                    "windless": [

                        "windless"

                    ],

                    "month": [

                        "month",

                        "months"

                    ]

                },

                {

                    "windless": [

                        "windless"

                    ],

                    "week": [

                        "week",

                        "weeks"

                    ]

                }

            ],

            "vector": [

                "muggy month",

                "windless month",

                "windless week", 

            ]

        }

    }

}

Note

This function can be called together with the function of the semantic similarity coefficients.

Synonyms 

Status: Active

Returns the synonyms for the given word (phrase) on the basis of the thesaurus.   

Description

The function returns the synonyms to the original word or phrase on the basis of synsets from the Yet Another RussNet thesaurus for Russian and from WordNet – for English. In a phrase the synonyms are selected for each word in the phrase (but auxiliary parts of speech) and then combined within the phrase.

In addition, for each word inside the phrase, the function returns the initial form and part of speech in the Universal POS tags format. For some auxiliary parts of speech (articles, auxiliary verbs), as well as punctuation marks and other symbols, synonyms are not selected - only the initial form and part of speech are returned.

Parameters

Parameter

Description

query

the search word or phrase (a string not more than 90 characters long) 

top

the maximum number of possible combinations (not more than 30)

lang

language («ru» or «en»)

format

the output format (should equal «json»)

token

the unique user’s key

Examples

Request Example

https://www.paraphraser.ru/api?c=syns&query=rainy day&top=3& lang=en&format=json&token=485…64

Response Example

{

    "code": 0,

    "response": {

        "1": {

            "original": "rainy day",

            "syns": [

                "showery twenty-four hours",

                "showery twenty-four hour period",

                "showery 24-hour interval",

            ],

            "lemma": "rainy day",

            "pos": "ADJ NOUN"

        }

    },

    "msg": "OK"

}

 

Note

The set of the function input parameters can be expanded to obtain coefficients of semantic similarity and word forms. So far, the function is active only for the Russian language. 

Detection of the Missing Part of the Sentence

Status: Active

Returns the meaning indicating a missing subject or predicate in the sentence. 

Description

The function takes a sentence for the input and checks if it has a subject and a predicate. 

Parameters

Parameter

Description

query

the search word or phrase (a string not more than 90 characters long) 

lang

language ru» or «en»)

format

the input format (should take the meaning «json»)

token

the unique user’s key

Examples

Request Example

https://paraphraser.ru/api?c=misent&query=rainy day&lang=en&format=json&token=485…64

Response Example

{

    "response": {

        "missing": ["predicate"],

        "phrase": [

            {

                "word": "rainy",

                "pos": "ADJ",

                "lemma": "rainy"

            },

            {

                "word": "day",

                "pos": "NOUN",

                "lemma": "day"

            }

        ]

    },

    "code": 0,

    "msg": "OK"

}

Hyponyms and Hypernyms

Status: Active

Returns hyponyms and hypernyms for words form the query.

Description

The function returns more specific (hyponyms) and more general (hypernyms) concepts for words from the query (except for auxiliary parts of speech) based on the Wiktionary data for Russian and on the WordNet data – for English. The hyponyms and hypernyms are put in the same form as the original word. In the case of a phrase, the function returns hyponyms and hypernyms of each word from the phrase separately (except for the auxiliary parts of speech).

Parameters

Parameter

Description

query

the search word or phrase (a string not more than 90 characters long) 

top

the maximum number of hyponyms and hypernyms (not more than 30)

lang

language ru» or «en»)

format

the input format (should equal «json»)

token

the unique user’s key

Examples

Request Example

https://www.paraphraser.ru/api?c=hyp&query=ищите женщину&top=3&lang=en&format=json&token=485…64

Response Example

{

    "code": 0,

    "response": {

        "1": {

            "original": "rainy day",

            "lemma": "rainy day",

            "pos": "ADJ NOUN",

            "hyponym": {

                "rainy": [],

                "day": [

                    "date",

                    "tomorrow",

                    "yesterday"

                ]

            },

            "hypernym": {

                "rainy": [],

                "day": [

                    "time unit",

                    "unit of time",

                    "time"

                ]

            },

        }

    },

    "msg": "OK"

}

Similarity of two Phrases

Status: Active

Returns semantic similarity score for two words or phrases.

Description

The function returns semantic similarity score for two words or phrases from the query. The score can be calculated in terms of semantic distributional model, synonymy relations or word formation relations depending on the user's choice.

Parameters

Parameter

Description

query

Two words or phrases separated by ";" (a string, not more than 90 characters)

type

Similarity score type (allowed values: "vector", "syn", "root")

lang

language ru» or «en»)

format

the input format (should equal «json»)

token

the unique user’s key

Examples

Request Example

https://www.paraphraser.ru/api?c=sim&query=cat;dog&type=vector&lang=en&format=json&token=485…64

Response Example

{

    "msg": "OK",

    "response": {

        "1": {

"sim": {

                "score": 0.7551

            },

            "original_1": "cat",

            "pos_1": "NOUN",

            "original_2": "dog",

            "pos_2": "NOUN",

            "lemma_1": "cat",

            "lemma_2": "dog"

        }

    },

    "code": 0

}

Note

All the three types of semantic similarity coefficients can be calculated only for Russian. For English available coefficients types are "vector" and "syn" ("root" defaults to "syn").

Centroid Detection

Status: Active

Returns the centroid of given words or phrases.

Description

The function returns the centroid of several words or phrases in terms of vector space model. The input words should be lemmatized and POS-tagged (with Universal POS tags), for example, "black_ADJ cat_NOUN;dog_NOUN;rabbit_NOUN".

Parameters

Parameter

Description

query

Several lemmatized and POS-tagged words or phrases separated by ";" (a string, not more than 90 characters)

lang

language ru» or «en»)

format

the input format (should equal «json»)

token

the unique user’s key

Examples

Request Example

https://www.paraphraser.ru/api?c=centroid&query=car_NOUN;bus_NOUN;plane_NOUN &lang=en&format=json&token=485…64

Response Example

{

    "response": {

        "centroid": "car_NOUN",

        "phrases": [

            "car_NOUN",

            "bus_NOUN",

            "plane_NOUN"

        ]

    },

    "code": 0,

    "msg": "OK"

}

The API Functions Being Developed

Sentiment Detection

Status: The Russian and English languages testing. The start date is 15.10.2017

The function returns the sentiment (general mood) of the query.

Description

The sentiment of the query is classified as positive, negative or neutral. 

Parameters

Parameter

Description

query

the search word or phrase (a string not more than 90 characters long) 

lang

language ru» or «en»)

format

the input format (should equal «json»)

token

the unique user’s key

Examples

Request Example

https://paraphraser.ru/api?c=sentiment&query=rainy day&lang=en&format=json&token=485…64

Response Example

{

    "code": 0,

    "response": {

        "sentiment": "negative"

    },

    "msg": "OK"

}

Topic Classification Using Wikipedia 

Status: The Russian and English languages testing. The start date is 15.10.2017

Returns the query topic using the Wikipedia classification.

Description

The function classifies the query topic on the basis of the Wikipedia categories.

Parameters

Parameter

Description

query

the search word or phrase (a string not more than 90 characters long) 

lang

language ru» or «en»)

format

the input format (should equal «json»)

token

the unique user’s key

Examples

Request Example

https://paraphraser.ru/api?c=wikitopic&query=rainy day&lang=en&format=json&token=485…64

Response Example

{

    "code": 0,

    "response": {

        "topics": [

                    "Jangle pop groups",

                    "Alternative rock groups from California"

        ]

    },

    "msg": "OK"

}

Text Paraphrasing

Status: The Russian and English languages testing. The start date is 15.12.2017

Full paraphrasing of texts with a specified proportion of replaceable words.

Description

The function accepts an input optional text of no more than 5000 characters and returns a paraphrased text, where part of the words is replaced by synonyms in the desired form of words. The percentage of the replaced words in the text is regulated by the user.

How It Looks Like

 

If you need additional functions, just write us: gf@EnduranceRobots.com

If you have a commercial query, call us: +7 916 225 4302

You can access the API via HTTP and HTTPS (the POST and GET methods are supported); besides you can access the API through a special form on:  

http://paraphraser.ru/api/form

The description of the API functions, instructions and examples of queries are to be found on:

http://paraphraser.ru/api/doc