Search code examples
deep-learningneural-networknlp

What neutal network (or other technique) can be used for text analyzing?


We need to automate cold conversations with clients. During those conversations, the neural network should rate a client's answers over a fixed set of questions, like:

  1. What is the chance that a client wants us to call them right now?
  2. What is the chance that a client wants us to call them later (and when)?
  3. What is the chance that a client doesn't want to talk further?

What products (paid or free) can be used? If that's a neural network, the model should be pre-trained.


Solution

  • In terms of neural network architectures, you need a sequence based model to do most text analysis, including yours, meaning that it needs to be able to take in an input of arbitrary length. In the modern world, for good performance that means either a transformer based architecture, or an LSTM/other recurrence network. Transformers tend to have better performance between these two, but either will probably work fine and there are plenty of free resources available for both.

    The primary problem with your question however, is that you want a pre-trained model and unfortunately that almost certainly doesn't exist for your purposes. Neural networks, and most AI models in general are highly case specific, by their nature. If I train a network to tell me if a sentence is positive or negative, there is no way to make it tell me anything else without some retraining, so for out of the box models you're most likely out of luck with that specific of a request.

    Now, some good news and bad news. Here's the good news: this retraining process can let you skip a lot of the computational work of training these kinds of models, via a process called transfer learning. Essentially you can take a pre-trained model thats good at a similar task and only retrain the last layer or couple layers, which requires a lot less data, computer time and effort.

    Here's the bad news: It still requires you to have some data, which if I'm reading your post correctly it doesn't seem like you have. Generating a dataset for this kind of task tends to be somewhat painful without (or even sometimes with) someone who knows what their doing and a lot of time.

    Here's what I recommend you do if (AND ONLY IF) you're very, very committed to this idea and can't find another way to do this or different automated service. Generate a dataset of pairs of sentences and . Go to Huggingface which is a repository of good pre-trained models, and find something vaguely similar to your task. Look up a tutorial on finetuning/retraining (huggingface has an alright one here: https://huggingface.co/docs/transformers/training) and follow it. After all that you might have a working model or you might have something that doesn't do what you want at all. For a comercial product like you're describing, it'll be the former for quite a few iterations most likely.

    Neural networks can do some truly amazing things, but to paraphrase one of my professors, they're only a panacea when you have infinite compute and infinite data, which aren't really in the cards.