情感分析
开发环境
http://dev-cn.your-api-server.com
开发环境
http://dev-cn.your-api-server.com
POST
/v2/text/sentiment_analysis
请求示例请求示例
Shell
JavaScript
Java
Swift
curl --location --request POST 'http://dev-cn.your-api-server.com/v2/text/sentiment_analysis' \
--header 'Authorization;' \
--header 'content-type: application/json' \
--data-raw '{
"response_as_dict": true,
"attributes_as_list": false,
"show_original_response": false
}'
响应示例响应示例
200 - 成功示例
{
"sapling": {
"general_sentiment": "Negative",
"general_sentiment_rate": 0.51,
"items": [
{
"segment": "Overall I am satisfied with my experience at Amazon, but two areas of major improvement needed.",
"sentiment": "Positive",
"sentiment_rate": 0.96
},
{
"segment": "First is the product reviews and pricing.",
"sentiment": "Neutral",
"sentiment_rate": 1
},
{
"segment": "There are thousands of positive reviews for so many items, and it's clear that the reviews are bogus or not really associated with that product.",
"sentiment": "Positive",
"sentiment_rate": 0.67
},
{
"segment": "There needs to be a way to only view products sold by Amazon directly, because many market sellers way overprice items that can be purchased cheaper elsewhere (like Walmart, Target, etc).",
"sentiment": "Neutral",
"sentiment_rate": 0.61
},
{
"segment": "The second issue is they make it too difficult to get help when there's an issue with an order.",
"sentiment": "Negative",
"sentiment_rate": 0.96
}
]
},
"google": {
"general_sentiment": "Negative",
"general_sentiment_rate": 0.4,
"items": [
{
"segment": "Overall I am satisfied with my experience at Amazon, but two areas of major improvement needed.",
"sentiment": "Neutral",
"sentiment_rate": 0
},
{
"segment": "First is the product reviews and pricing.",
"sentiment": "Neutral",
"sentiment_rate": 0
},
{
"segment": "There are thousands of positive reviews for so many items, and it's clear that the reviews are bogus or not really associated with that product.",
"sentiment": "Negative",
"sentiment_rate": 0.5
},
{
"segment": "There needs to be a way to only view products sold by Amazon directly, because many market sellers way overprice items that can be purchased cheaper elsewhere (like Walmart, Target, etc).",
"sentiment": "Negative",
"sentiment_rate": 0.6
},
{
"segment": "The second issue is they make it too difficult to get help when there's an issue with an order.",
"sentiment": "Negative",
"sentiment_rate": 0.8
}
]
},
"microsoft": {
"general_sentiment": "Negative",
"general_sentiment_rate": 0.67,
"items": [
{
"segment": "Overall I am satisfied with my experience at Amazon, but two areas of major improvement needed. ",
"sentiment": "Positive",
"sentiment_rate": 0.98
},
{
"segment": "First is the product reviews and pricing. ",
"sentiment": "Neutral",
"sentiment_rate": 0.99
},
{
"segment": "There are thousands of positive reviews for so many items, and it's clear that the reviews are bogus or not really associated with that product. ",
"sentiment": "Negative",
"sentiment_rate": 1
},
{
"segment": "There needs to be a way to only view products sold by Amazon directly, because many market sellers way overprice items that can be purchased cheaper elsewhere (like Walmart, Target, etc). ",
"sentiment": "Neutral",
"sentiment_rate": 0.7
},
{
"segment": "The second issue is they make it too difficult to get help when there's an issue with an order.",
"sentiment": "Negative",
"sentiment_rate": 1
}
]
},
"emvista": {
"general_sentiment": "Positive",
"general_sentiment_rate": 0.45,
"items": []
},
"tenstorrent": {
"general_sentiment": "Negative",
"general_sentiment_rate": 0.38,
"items": []
},
"connexun": {
"general_sentiment": "Negative",
"general_sentiment_rate": 0.38,
"items": []
},
"ibm": {
"general_sentiment": "Negative",
"general_sentiment_rate": 0.54,
"items": []
},
"lettria": {
"general_sentiment": "Negative",
"general_sentiment_rate": 0.27,
"items": [
{
"segment": "overall i am satisfied with my experience at Amazon , but two areas of major improvement needed .",
"sentiment": "Positive",
"sentiment_rate": 0.71
},
{
"segment": "first is the product reviews and pricing .",
"sentiment": "Positive",
"sentiment_rate": 0.01
},
{
"segment": "there are thousands of positive reviews for so many items , and it is clear",
"sentiment": "Positive",
"sentiment_rate": 0.38
},
{
"segment": "there needs to be a way to only view products sold by Amazon directly , because many market sellers way overprice items that can be purchased cheaper elsewhere ( like Walmart , Target , etc ) .",
"sentiment": "Negative",
"sentiment_rate": 0.23
},
{
"segment": "the second issue is they make it too difficult to get help when there is an issue with an order .",
"sentiment": "Neutral",
"sentiment_rate": 0
}
]
},
"openai": {
"general_sentiment": "Negative",
"general_sentiment_rate": 0.3,
"items": []
},
"amazon": {
"general_sentiment": "Negative",
"general_sentiment_rate": 0.4,
"items": []
},
"nlpcloud": {
"general_sentiment": "Negative",
"general_sentiment_rate": 0.97,
"items": []
}
}
请求参数
Header 参数
content-type
string
必需
示例值:
application/json
Authorization
string
必需
默认值:
Bearer <your_key>
Body 参数application/json
返回响应
修改于 2024-04-11 06:56:02