This library allows you to classify text for sentiment analysis purpose and perform question answering
Usage
This library allows you to connect to Hugging Face's NLP services:
Sentiment analysis
do sentiment = App("huggingface", method="sentimentAnalysis", text="I love apples")
// The response will be a object that include a label : an integer on a scale from 1 to 5, 1 being positive, and 5 positive
say "{{sentiment}}"
/*
{
success: true,
"response": {
"label": "5", "score": 0.8546807765960693
}
}
*/
Question answering
do answer = App("huggingface", method="questionAnswering", question="Where is Brian ?", context="Brian is in the kitchen")
// The response provides the answer to the question that is present in the context
say "{{answer}}"
/*
{
"success": true,
"response": {
"score": 0.7264901669999388,
"start": 9,
"end": 22,
"answer": "in the kitchen"
}
}
*/