📜 ⬆️ ⬇️

The use of machine learning to analyze a large number of feedback from respondents

Any modern company cares about its reputation. Phrases: “Your opinion is very important for us” or “Evaluate your purchase”, “Would you recommend our company?” Literally follow us at every step on the websites of shops, clinics and even public services. Government agencies along with other companies have become interested in evaluating their work and also pay attention to this. Medical institutions will not renew contracts with specialists who have a negative background for a long time. Service providers try to constantly monitor the reaction of consumers to goods and services in order to make their service more affordable and high-quality, and therefore competitive. Popular opinion helps other consumers to get an idea about an institution, establishment, product or service before it is purchased and thus avoids mistakes when shopping. Large companies necessarily have in their staff a structure to combat the outflow of customers, PR departments, in whose work a key factor is timely response to consumer requests. How to build the work of such structures without increasing costs and increase their speed of response? As one example, consider the use of machine learning for the operational analysis of a large number of feedback from respondents.



Multilingual


')
To begin, consider an example demonstrating the features of the modern UX / UI approach to developing a user interface. Suppose you are the owner of a multinational company providing services worldwide.



After each purchase you contact your customers with a request to leave feedback about your product. Technically, your current software is organized in such a way that regardless of the language in which users leave feedback, they fall into the “basement” of the product. The problem arises of how to determine the language of a review, what its tonality is, and in the best case, translate it into several languages ​​and demonstrate a suitable translation of all reviews for the current user in his native language, regardless of the original language.
If you contact your developer now, then most likely you will be offered an option in which the task of choosing the language will be assigned to the user's shoulders. It will probably look like this.



The user will be asked to select a language from a long list, and sometimes languages ​​are listed without translation, which in turn puts the user at a standstill. It looks like this



If we assume that the majority of users are fluent in two languages, then only two lines will be clear to them; in fact, the choice turns into “torture”.

Another equally popular approach that you can offer is to determine the region by IP address and, as a result, the most likely common language. The condition of modern globalization is not the best approach. To point out its shortcomings, it is enough just to note the intrusiveness of modern software in relation to the region of your location; only Moscow residents are lucky in this regard, most likely their region is always determined correctly.

Machine learning



One of the elegant ways to eliminate such problems can be machine learning. Currently, for this, there is no need to deeply understand mathematics. For example, it is enough to use MS Azure Cognitive Service



which, according to the entered phrase, will allow to determine a number of indicators of the entered text, including language, key phrases and its tonality. For the case in question, this gives the following interface simplification.



You no longer need to request the input language and user rating - these facts automatically follow. After that, the task of distributing requests to regional branches, as well as monitoring the outflow of customers, is greatly simplified.



A significant part of the effort is shifted from the user and employees to a machine that does not get tired, works quickly and makes much less mistakes in mechanical aspects.



Cognitive service



First of all, you need to connect to the MS Azure Cognitive Service and get access to the API that analyzes the specified text and return its characteristics. This process is not complicated and will be discussed in more detail in a separate article.



You can access the API in two ways using an HTTP request and using a client. In particular, for .net you need to connect the package


further call API
var httpWebRequest = (HttpWebRequest)WebRequest.Create("https://northeurope.api.cognitive.microsoft.com/text/analytics/v2.0/languages"); httpWebRequest.Method = "POST"; httpWebRequest.Headers.Add("Content-Type:application/json"); httpWebRequest.Headers.Add("Ocp-Apim-Subscription-Key:61..."); var documents = new Documents(); documents.Add(new Document(Description)); using (var streamWriter = new StreamWriter(httpWebRequest.GetRequestStream())) { string json = JsonConvert.SerializeObject(documents); streamWriter.Write(json); streamWriter.Flush(); streamWriter.Close(); } 

and parse the answer received

 var httpResponse = (HttpWebResponse)httpWebRequest.GetResponse(); String response; using (var streamReader = new StreamReader(httpResponse.GetResponseStream(), Encoding.UTF8)) { response = streamReader.ReadToEnd(); } var result = JsonConvert.DeserializeObject<DocumentsResult>(response); var doc = result.documents[0].detectedLanguages[0]; 

If we write the data in the database, we get the following


(The example is added after the user comments to the article)


Results analysis



We will analyze the results, for this we will build several reports using the FastReport software package which has in its delivery an open-source version

youtu.be/Tyu7v24zer0

Turning on the sorting by tonality (1-positive, 0-negative) we get the positive feedback grouped at the top and the negative feedback grouped at the bottom.

youtu.be/HbuXMuDZFmo

If necessary, you can group reviews by language and send relevant reports to regional offices

youtu.be/YF8RG3g5FRs

Conclusion



New technologies not only significantly improve the user interface, but also optimize the work of employees, reduce development costs. Refuse expensive modification of existing software. The prospects for machine learning in the near future will significantly improve software quality and user satisfaction. The use of easily implemented report building solutions will allow more users to access data without heavy programming.

Links



github.com/ufocombat/Languages-open
azure.microsoft.com/en-us/services/cognitive-services/text-analytics
www.fast-report.com/en
youtu.be/Tyu7v24zer0
youtu.be/HbuXMuDZFmo
youtu.be/YF8RG3g5FRs

Source: https://habr.com/ru/post/445726/


All Articles