Batch detect sentiments over pre-deployed model.

POST {{baseUrl}}/actions/batchDetectLanguageSentiments?level=SENTENCE&level=SENTENCE

The API extracts aspect-based and sentence level sentiment in text records.

For aspect-based sentiment analysis, a set of aspects and their respective sentiment is returned for each record. Similarly, for sentence-level sentiment analysis, the sentiment is returned at the sentence level.

For sentiment analysis, confidence scores are provided for each of the classes (positive, negative, neutral and mixed).

Learn more about sentiment analysis here.

Limitations: - A batch may have up to 100 records. - A record may be up to 5000 characters long. - The total of characters to process in a request can be up to 20,000 characters.

Request Params

KeyDatatypeRequiredDescription
levelstringSet this parameter for sentence and aspect level sentiment analysis.
Allowed values are:
  • ASPECT
  • SENTENCE | | level | string | | Set this parameter for sentence and aspect level sentiment analysis. Allowed values are:
  • ASPECT
  • SENTENCE |

Request Body

{"documents"=>[{"key"=>"Red Bull", "text"=>"Red Bull Racing Honda, the four-time Formula-1 World Champion team, has chosen Oracle Cloud Infrastructure (OCI) as their infrastructure partner.", "languageCode"=>"en"}, {"key"=>"sit proident qui", "text"=>"OCI recently added new services to existing compliance program including SOC, HIPAA, and ISO to enable our customers to solve their use cases. We also released new white papers and guidance documents related to Object Storage, the Australian Prudential Regulation Authority (APRA), and the Central Bank of Brazil. These resources help regulated customers better understand how OCI supports their regional and industry-specific compliance requirements. Not only are we expanding our number of compliance offerings and regulatory alignments, we continue to add regions and services at a faster clip.", "languageCode"=>"en"}]}

HEADERS

KeyDatatypeRequiredDescription
opc-request-idstringThe client request ID for tracing.
Content-Typestring
Acceptstring

RESPONSES

status: OK

{"documents":[{"aspects":[{"length":-89933217,"offset":-44917725,"scores":{"dolore2":5366828.3765716255,"occaecat_c8_":-52595934.82532296},"sentiment":"aliquip eu","text":"dolor cillum mollit"},{"length":-41126267,"offset":25982063,"scores":{"esse_2":-1700544.0560985655},"sentiment":"ea laborum quis tempor","text":"sit"}],"key":"laborum sed sunt","languageCode":"sed mollit ullamco culpa fugiat","documentScores":{"pariatur_a":89414949.82200223,"officiaeff":-86567016.24981004,"magna_c":-18169823.073888704},"documentSentiment":"amet occaecat","sentences":[{"length":-57336869,"offset":-11916212,"scores":{"occaecat_52":-94926102.19864841,"officia9":21851122.329384103},"sentiment":"Lorem sint commodo dolor reprehenderit","text":"labore Excepteur"},{"length":18082069,"offset":82814516,"scores":{"doa":21957533.48118989},"sentiment":"et magna","text":"dolore in tempor magna"}]},{"aspects":[{"length":-26691620,"offset":-1514942,"scores":{"dolore_0c":9208728.824560627,"in1":-97317276.0973493},"sentiment":"ut nostrud sit amet","text":"ex nisi ad cupidatat"},{"length":-61871816,"offset":-71696305,"scores":{"ex_5":-3352324.5386966467},"sentiment":"dolore pariatur id","text":"dolor labore magna"}],"key":"ut","languageCode":"quis ex in dolore ad","documentScores":{"in_a57":6075803.925515056,"id__39":23327083.650925398,"dolore7f_":76306018.28393742,"consequat_2":-84907731.58998768,"deserunt_1":59257931.75961545},"documentSentiment":"","sentences":[{"length":4776794,"offset":-81371089,"scores":{"enimaa4":57569716.44944504},"sentiment":"amet","text":"occaecat"},{"length":-6339966,"offset":-34054911,"scores":{"Excepteur_434":-7695600.1185076535},"sentiment":"aute ea officia","text":"incididunt anim eiusmod Lorem"}]}],"errors":[{"error":{"code":"anim nostrud in ea","message":"ex nisi"},"key":"ut dolo"},{"error":{"code":"est enim","message":"dolore commodo consequat"},"key":"amet do"}]}