Peer-reviews-NLP: Web Service API: Difference between revisions

From Expertiza_Wiki
Jump to navigation Jump to search
No edit summary
No edit summary
 
Line 1: Line 1:
This page will contain information on the API calls appropriate for the PRWS.
This page will contain information on the API calls appropriate for the PRWS.


=Volume=
==Volume==
The volume metric gives the count of words in text. The volume of the text is generated by using NLTK tokenizer library. We token the text first followed by removing the stop words.
The volume metric gives the count of words in text. The volume of the text is generated by using NLTK tokenizer library. We token the text first followed by removing the stop words.


==Output Parameters==
===Output Parameters===
# Total Volume of the text: The total number of words present in the text
# Total Volume of the text: The total number of words present in the text
# Volume without stopwords: This parameter extracts the count of useful set of words from the text. It returns the text which does not have stop-words( articles, punctuations, etc)
# Volume without stopwords: This parameter extracts the count of useful set of words from the text. It returns the text which does not have stop-words( articles, punctuations, etc)


==Accessing the service==
===Accessing The Service===
Send a POST request to <domain-name>/volume. In case of running locally, domain name will be localhost:5000.
Send a POST request to <domain-name>/volume. In case of running locally, domain name will be localhost:5000.
The request will be sent via request body. You can refer to the API documentation and try out this feature at <domain-name>/documentation.
The request will be sent via request body. You can refer to the API documentation and try out this feature at <domain-name>/documentation.


=Sentiment=
 
==Sentiment==
This metric will detect the sentiment of the writer in text. The sentiments are detected using Google Natural Language API. The API will return us with the sentiment score after analyzing the text with a value between -1 and 1. The sentiments are classified into 4 types.
This metric will detect the sentiment of the writer in text. The sentiments are detected using Google Natural Language API. The API will return us with the sentiment score after analyzing the text with a value between -1 and 1. The sentiments are classified into 4 types.
# Positive: A review is said to be positive if it predominantly contains positive feedback. Adjectives such as “well organized”, “complete” and “accurate” are indicators of a positive semantic orientation.
# Positive: A review is said to be positive if it predominantly contains positive feedback. Adjectives such as “well organized”, “complete” and “accurate” are indicators of a positive semantic orientation.
Line 20: Line 21:
# Mixed: A mixed sentiment will contain positive as well as negative sentiment at the same time.
# Mixed: A mixed sentiment will contain positive as well as negative sentiment at the same time.


==Output Parameters==
===Output Parameters===


# Sentiment Score: This will be a score assigned to the sentiment ranging from -1.0 (negative) to 1.0 (positive), which corresponds to emotional leaning of the text.
# Sentiment Score: This will be a score assigned to the sentiment ranging from -1.0 (negative) to 1.0 (positive), which corresponds to emotional leaning of the text.
# Sentiment Tone: Based on the score, the tone is classified into 4 categories positive, negative, neutral, mixed.
# Sentiment Tone: Based on the score, the tone is classified into 4 categories positive, negative, neutral, mixed.


==Accessing the service==
===Accessing The Service===
Send a POST request to <domain-name>/sentiment. In case of running locally, domain name will be localhost:5000. You can refer to the API documentation and try out this feature at <domain-name>/documentation.
Send a POST request to <domain-name>/sentiment. In case of running locally, domain name will be localhost:5000. You can refer to the API documentation and try out this feature at <domain-name>/documentation.


=Emotion=
 
==Emotion==
This parameter will reflect the emotional quotient of the text. This will tell the level of praise or criticism present in the text. The emotions are obtained using Google Natural Language API which returns the magnitude of the sentiment as well as sentiment score. Depending on the combination of score and magnitude, we assign if it is a praise or
This parameter will reflect the emotional quotient of the text. This will tell the level of praise or criticism present in the text. The emotions are obtained using Google Natural Language API which returns the magnitude of the sentiment as well as sentiment score. Depending on the combination of score and magnitude, we assign if it is a praise or
criticism. Sentiment magnitude between 0.6 and 1.5 is considered as low for either praise or criticism and sentiment magnitude greater than 1.5 is considered to as high. This threshold was decided by Google as we are using their API.
criticism. Sentiment magnitude between 0.6 and 1.5 is considered as low for either praise or criticism and sentiment magnitude greater than 1.5 is considered to as high. This threshold was decided by Google as we are using their API.


==Output Parameters==
===Output Parameters===
# Praise: The parameter will tell about the level of praise in the text. Values can be “high” or “low”
# Praise: The parameter will tell about the level of praise in the text. Values can be “high” or “low”
# Criticism: The parameter will tell us about the level of criticism present in the text. Values can be either ”high” or “low”
# Criticism: The parameter will tell us about the level of criticism present in the text. Values can be either ”high” or “low”


==Accessing the service==
===Accessing The Service===
Send a POST request to <domain-name>/emotions. In case of running locally, domain name will be localhost:5000. You can refer to the API documentation and try out this feature at <domain-name>/documentation.
Send a POST request to <domain-name>/emotions. In case of running locally, domain name will be localhost:5000. You can refer to the API documentation and try out this feature at <domain-name>/documentation.


=Suggestion Detection=
 
==Suggestion Detection==
This method will detect the presence of suggestions in the text. This is implemented by Kai and his team in the Machine Learning for Peer Assessment group. I was given with the model directly and the expected output. The trained model can be found in the git repo under models directory.
This method will detect the presence of suggestions in the text. This is implemented by Kai and his team in the Machine Learning for Peer Assessment group. I was given with the model directly and the expected output. The trained model can be found in the git repo under models directory.


==Output Parameters==
===Output Parameters===
# Suggestions: The values are “present” or “absent”
# Suggestions: The values are “present” or “absent”


==Accessing the service==
===Accessing the service===
Send a POST request to <domain-name>/suggestions. In case of running locally, domain name will be localhost:5000. You can refer to the API documentation and try out this feature at <domain-name>/documentation.
Send a POST request to <domain-name>/suggestions. In case of running locally, domain name will be localhost:5000. You can refer to the API documentation and try out this feature at <domain-name>/documentation.


=Problem Detection=
 
==Output Parameters==
==Problem Detection==
===Output Parameters===
This method will detect if the text mentions any problems. Example (see below): If there is a text which mentions the possible problems in the reviewed product, then this service
This method will detect if the text mentions any problems. Example (see below): If there is a text which mentions the possible problems in the reviewed product, then this service
will be able to detect this. This feature was created by Kai and his team in the Machine Learning for Peer Assessment group. I was given with the model directly and the expected output. The trained model can be found in the git repo under models directory. The directory also contains preprocessor model which can be used in future for training any data.
will be able to detect this. This feature was created by Kai and his team in the Machine Learning for Peer Assessment group. I was given with the model directly and the expected output. The trained model can be found in the git repo under models directory. The directory also contains preprocessor model which can be used in future for training any data.




==Accessing the service==
===Accessing the service===
Send a POST request to <domain-name>/problems. In case of running locally, domain name will be localhost:5000. You can refer to the API documentation and try out this feature at
Send a POST request to <domain-name>/problems. In case of running locally, domain name will be localhost:5000. You can refer to the API documentation and try out this feature at
<domain-name>/documentation.
<domain-name>/documentation.

Latest revision as of 02:16, 25 January 2022

This page will contain information on the API calls appropriate for the PRWS.

Volume

The volume metric gives the count of words in text. The volume of the text is generated by using NLTK tokenizer library. We token the text first followed by removing the stop words.

Output Parameters

  1. Total Volume of the text: The total number of words present in the text
  2. Volume without stopwords: This parameter extracts the count of useful set of words from the text. It returns the text which does not have stop-words( articles, punctuations, etc)

Accessing The Service

Send a POST request to <domain-name>/volume. In case of running locally, domain name will be localhost:5000. The request will be sent via request body. You can refer to the API documentation and try out this feature at <domain-name>/documentation.


Sentiment

This metric will detect the sentiment of the writer in text. The sentiments are detected using Google Natural Language API. The API will return us with the sentiment score after analyzing the text with a value between -1 and 1. The sentiments are classified into 4 types.

  1. Positive: A review is said to be positive if it predominantly contains positive feedback. Adjectives such as “well organized”, “complete” and “accurate” are indicators of a positive semantic orientation.
  2. Negative: A review is negative if it has a lot of words with negative semantic orientation. Negative reviews try to find out the fault in the review and thus might offend.
  3. Neutral : Reviews that do not contain either positively or negatively oriented words or phrases, or contain an equal number of both are considered to be neutral. Example: “The organization looks good overall. But lots of IDEs are mentioned in the first part and only a few of them are compared with each other. I did not understand the reason for that.” This review contains both positively and negatively oriented segments: “The organization looks good overall” is positively oriented, while “I did not

understand the reason for that.” is negatively oriented. The positive and negatively oriented words when taken together give this review a neutral orientation.

  1. Mixed: A mixed sentiment will contain positive as well as negative sentiment at the same time.

Output Parameters

  1. Sentiment Score: This will be a score assigned to the sentiment ranging from -1.0 (negative) to 1.0 (positive), which corresponds to emotional leaning of the text.
  2. Sentiment Tone: Based on the score, the tone is classified into 4 categories positive, negative, neutral, mixed.

Accessing The Service

Send a POST request to <domain-name>/sentiment. In case of running locally, domain name will be localhost:5000. You can refer to the API documentation and try out this feature at <domain-name>/documentation.


Emotion

This parameter will reflect the emotional quotient of the text. This will tell the level of praise or criticism present in the text. The emotions are obtained using Google Natural Language API which returns the magnitude of the sentiment as well as sentiment score. Depending on the combination of score and magnitude, we assign if it is a praise or criticism. Sentiment magnitude between 0.6 and 1.5 is considered as low for either praise or criticism and sentiment magnitude greater than 1.5 is considered to as high. This threshold was decided by Google as we are using their API.

Output Parameters

  1. Praise: The parameter will tell about the level of praise in the text. Values can be “high” or “low”
  2. Criticism: The parameter will tell us about the level of criticism present in the text. Values can be either ”high” or “low”

Accessing The Service

Send a POST request to <domain-name>/emotions. In case of running locally, domain name will be localhost:5000. You can refer to the API documentation and try out this feature at <domain-name>/documentation.


Suggestion Detection

This method will detect the presence of suggestions in the text. This is implemented by Kai and his team in the Machine Learning for Peer Assessment group. I was given with the model directly and the expected output. The trained model can be found in the git repo under models directory.

Output Parameters

  1. Suggestions: The values are “present” or “absent”

Accessing the service

Send a POST request to <domain-name>/suggestions. In case of running locally, domain name will be localhost:5000. You can refer to the API documentation and try out this feature at <domain-name>/documentation.


Problem Detection

Output Parameters

This method will detect if the text mentions any problems. Example (see below): If there is a text which mentions the possible problems in the reviewed product, then this service will be able to detect this. This feature was created by Kai and his team in the Machine Learning for Peer Assessment group. I was given with the model directly and the expected output. The trained model can be found in the git repo under models directory. The directory also contains preprocessor model which can be used in future for training any data.


Accessing the service

Send a POST request to <domain-name>/problems. In case of running locally, domain name will be localhost:5000. You can refer to the API documentation and try out this feature at <domain-name>/documentation.