1
$\begingroup$

I am new to NLP realm. If you have an input text "The price of orange has increased" and output text "Increase the production of orange". Can we make our RNN model to predict the output text? Or what algorithm should I use?

$\endgroup$
  • $\begingroup$ 2 ways really, both involve converting the input to a 1-hot input. Either convert each character to a 1 hot input (eg, of size 27, 26 in the alphabet, 1 for spaces), or convert each word to a 1 hot vector of the RNN's vocabulary, $\endgroup$ – Recessive Sep 9 at 7:07
0
$\begingroup$

In your case you can use either RNN (especially BiLSTM with ELMo and attention mechanism for better accuracy) or Transformer based architectures (the best of them today is BERT). But for both cases you need data to train the model (i.e sequences of input/output like in your question).

I believe the best choice in your case is BERT as it's achieving state of the art performance in most NLP tasks and is already pretrained so you don't need a massive data to retrain the model. Also, BERT is pretrained on "Next Sentence Prediction" and allows "2 separate sentences" as input which helps a lot in your case. The only drawback, compared to other methods, is that you need fine-tuning the model so it's not a completly "ready to use" model.

For more information:

Here is the github repository of BERT: BERT-repo. For quick explanation check: The Illustrated BERT. For detailed explanation see BERT paper: BERT-paper.

$\endgroup$
0
$\begingroup$

sounds like a job for Sequence-to-sequence or seq2seq

for example tf-seq2seq

you basically use an RNN as an encoder (reduces and sequence of words to a vector), and another RNN as a decoder (takes the encoded vector as in input to generation a new sequence of words).

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.