The Comment IQ API is a RESTful API used to evaluate comments on news articles and return scores based on four criteria shown to correlate with higher quality comments: Article Relevance, Conversational Relevance, Personal Experience, and Readability.
These four criteria are explained briefly below, and in more detail in two research papers (including their validation as measures of higher quality comments):
N. Diakopoulos. The Editor’s Eye: Curation and Comment Relevance on the New York Times. Proc. Conference on Computer Supported Cooperative Work (CSCW). 2015. [PDF]
N. Diakopoulos. Picking the NYT Picks: Editorial Criteria and Automation in the Curation of Online News Comments. #ISOJ Journal. 2015. [PDF]
To install the API code and run it locally on your own server follow the instructions here
####Article Relevance
This criterion calculates the comment score based on article similarity. The Article Relevance score is calculated by taking the cosine similarity or dot product of the respective normalized feature vectors for a comment and article to which it is attached.
####Conversational Relevance
Conversational Relevance measures how similar a comment is to other comments on the same article. To measure conversational relevance, for each article’s comments a centroid feature vector is created representing the text of all of the comments on the article that were posted before a given comment. This represents the terms used across the thread up to that point in time. Then, for the next comment in the thread its cosine similarity to this centroid representation is calculated in order to measure the comment’s conversational relevance.
Personal Experience
The Personal Experience score is a measure of expressions of personal experiences calculated by counting the rate of use of words in Linguistic Inquiry and Word Count (LIWC) categories “I”, “We”, “Family”, and “Friends” which would reflect personal (1st and 3rd person pronouns) and close relational (i.e. family and friends) experiences.
Readability
The Readability score is calculated as the SMOG index or reading grade level of the text.
Length
The Length score is computed as the number of words in a comment.
###How to use the CommentIQ API
There are 11 Different endpoints currently available, with their specific function, parameters and responses as described below. The basic gist of it is that you pass the API content (articles, and then comments associated with those articles) and the API will pass back the relevant scores. In order to provide a faster response time, content is cached on the CommentIQ server, which means that if your content changes (e.g. if an article is updated, or a comment is updated or deleted) you need to use the corresponding API endpoints so that the CommentIQ cache is synced and returning accurate scores.
For new articles, article text needs to be sent via an HTTP POST method and an auto generated ArticleID will be sent in response. This Article ID needs to be kept track of in order to update the article or to add comments to the article in the future. Note: Article ID is crucial in order to get the comment score
To update articles - updated article text and ArticleID needs to be sent via an HTTP POST method. Note: It is important to update the API database with updated article text if it changes in order to calculate the correct Article Relevance Score for a comment.
For new comments - Comment Text and Article ID need to be sent via an HTTP POST method. All the scores will be calculated and sent via Response. An auto-generated commentID will also be sent in response. In order to get
best results for conversational relevance make sure to add the comments of an article in chronological order.
Note: This Comment ID needs to be kept track of in order to update or delete the comment in the future.
]]]To update comment - Comment Text and Comment ID needs to be sent via an HTTP POST method. All the scores will be calculated and sent via the Response. Note: It is important to update the API with comment text that has changed in order to calculate the correct scores for a comment.
To delete a comment - Comment ID needs to be sent via an HTTP DELETE method. Note: Since Conversational Relevance depends upon all the previous comments, the database needs to be updated with any deleted comment(s).
To get the Article Relevance Score of a comment - the Comment ID needs to be sent via an HTTP GET method. The Article Relevance score will be fetched and sent via Response.
To get the Conversational Relevance Score of a comment - the Comment ID needs to be sent via HTTP GET method. The Conversational Relevance score will be fetched and sent via Response.
To get the Personal Experience Score of a comment - the Comment ID needs to be sent via HTTP GET method. The Personal Experience score will be fetched and sent via Response.
To get the Readability Score of a comment - Comment ID needs to be sent via an HTTP GET method. The Readability score will be fetched and sent via Response.