Skip to content

Syntactic analysis of customer feedback

alessandrousseglioviretta edited this page Mar 5, 2013 · 6 revisions

How to automatically process customer feedback messages

Most companies receive large number of messages from their customers which need to be processed by the company's customer care. Automatic analysis, dispatching and prioritization of customer feedback is very important to keep the level of customer satisfaction high. Automatic text classification allows to assign feedback messages to classes. If the classes are positive and negative, the classification process is commonly called sentiment analysis. One further step in the processing aims at extracting relevant data from the messages. Syntactic analysis splits human language into its constituents, for example, a sentence's subject and objects. Here is an example in German with the following customer feedback: "Der Fernsehempfang ist gut, die Internetverbindung war aber langsam und der Kundendienst ist nicht freundlich." (translation)

The text needs to be packages in JSON format in the following way:

{
    "language": "de",
    "text": "Der Fernsehempfang ist gut, die Internetverbindung war aber langsam und der Kundendienst 
ist nicht freundlich.",
    "pattern": "{NN|SBJ} VB **? {JJ}"
}

The pattern tells the syntactic analysis engine which word sequences to extract (Don't worry: we'll create for you the patterns you need). In this case, it's a noun used as a subject, followed by any verb and eventually ad adjective. The verb and the adjective can be separated by any number of words. The result is the following:

{
    "kind": "search#syntactic",
    "matches": [
        {
            "match": "Fernsehempfang ist gut"
        },
        {
            "match": "Internetverbindung war aber langsam"
        },
        {
            "match": "Kundendienst ist nicht freundlich"
        }
    ],
    "pattern": "{NN|SBJ} VB **? {JJ}"
}

Customers often complain about problems, so let's extract the words following the work 'Probleme' (German for 'problems', as yo might have guessed) in the following customer feedback: "Ich habe mehrmals täglich Internetunterbrüche bis zu 2 Stunden und immer wieder Probleme mit dem Telefon." (translation). By submitting the following JSON-formatted data to the Ghib.li web service:

{
    "language": "de",
    "text": "Ich habe mehrmals täglich Internetunterbrüche bis zu 2 Stunden und immer wieder Probleme 
mit dem Telefon.",
    "pattern": "probleme **?+ NN"
}

the server response will be:

{
    "kind": "search#syntactic",
    "matches": [
        {
            "match": "Probleme mit dem Telefon"
        }
    ],
    "pattern": "probleme **?+ NN"
}

The syntactic analysis does not only work as a search engine, but it also select the relevant part of the message, that can be then forwarded to an operator, stored for reference or further processed.

This last example shows how to extract single words instead of sentences. By submitting the followinf data to the Ghib.li web service:

{
    "language": "de",
    "text": "Der Fernsehempfang ist gut, die Internetverbindung war aber langsam und der Kundendienst 
ist nicht freundlich.",
    "pattern": "NN? nicht? JJ?"
}

the result is:

{
    "kind": "search#syntactic",
    "matches": [
        {
            "match": "Fernsehempfang"
        },
        {
            "match": "gut"
        },
        {
            "match": "Internetverbindung"
        },
        {
            "match": "langsam"
        },
        {
            "match": "Kundendienst"
        },
        {
            "match": "nicht"
        },
        {
            "match": "freundlich"
        }
    ],
    "pattern": "NN? nicht? JJ?"
}

which selects and separates all most relevant words in the feedback message.

In a typical application, the syntactic analysis search covers a number of patterns that are aimed at selecting different kinds of complaints related to different business areas.

Clone this wiki locally