Technology Blogs by SAP
Learn how to extend and personalize SAP applications. Follow the SAP technology blog for insights into SAP BTP, ABAP, SAP Analytics Cloud, SAP HANA, and more.
cancel
Showing results for 
Search instead for 
Did you mean: 
former_member298194
Participant
Classification of support tickets by machine learning is a well-known use case, but in the course of working with customers on this problem, we have come across a frequent problem where customers do not yet have (good) enough data for training a customized model that can classify according to their business categories.

One of the ways to overcome this entry barrier is to use pre-trained Natural Language Processing (NLP) models that detect the ticket language or sentiment to help in ticket triage.

In the 2003 update of Service Ticket Intelligence, we added support for language and sentiment detection for the Classification API. As these are pre-trained models, there is no need for training, and using it is as simple as specifying this in the Services Object during the inference call.

See Classification API Examples

Hang on - wasn't language detection always in the classification API?


Yes, it was - what we made possible now is the ability to get the detected language even without any models trained (or activated).

Here are the environment variables in postman:

Notice below that there is no need to enter a value for model_id if you are using the pre-trained services.



Next, step through the postman collection with the following:

  • Get Access Token

  • List active models

  • Classify single message (with services options) > sample code below


Here's the response from List active models, showing that there are currently no active models in my account.
{
"results": [],
"status": 0,
"status_message": "ok"
}

 

Request to classify a single message with services options
{  
"business_object": "ticket",
"messages":[
{
"id": 2001,
"contents": [
{
"field": "null",
"value": "I would like a refund for my recently purchased phone. Can you please send a return label?"
}]
}
],
"options": {
"services":
{
"detect_language": true,
"detect_sentiment": true
}
}
}

"field" is a required property generally used to describe the input field to classify in a custom model. In this case, it does not matter what the value is in the "field" property.

Sample Response
{
"results": [
{
"detected_language": "en",
"id": 2001,
"sentiment": {
"overall_score": 0
},
"status": 0,
"status_message": "ok"
}
]
}

 

Great! So can I also add these services to my custom trained model?


Yes, you can - you would need to add "detect_category" to the services object. In this request below, I have already activated one of the models which I trained earlier with both category & priority.

Sample request
{  
"business_object": "ticket",
"messages":[
{
"id": 2001,
"contents": [
{
"field": "text",
"value": "I would like a refund for my recently purchased phone. Can you please send a return label?"
}]
}
],
"options": {
"services":
{
"detect_category": true,
"detect_language": true,
"detect_sentiment": true
}
}
}

Sample response
{
"results": [
{
"classification": [
{
"confidence": 0.9848724603652954,
"field": "label",
"value": "request"
},
{
"confidence": 0.9007545709609985,
"field": "priority",
"value": "Normal"
}
],
"detected_language": "en",
"id": 2001,
"sentiment": {
"overall_score": 0
},
"status": 0,
"status_message": "ok"
}
]
}

 

Service Ticket Intelligence is part of the SAP AI Business Services portfolio which are available via the Cloud Platform Enterprise Agreement for consumption-based pricing. In the coming days, look out for the developer trial of Service Ticket Intelligence on the SAP Cloud Platform Trial.