Skip to main content

NLG pipeline

NLG

NLG stands for Natural Languate Generation. NLG is one field of AI aims to generate the understandable and appropriate texts from raw data. We should differientiate the concepts of NLG with NLP and NLU. NLP is natural languate processing. This is a field in AI working on text generally. NLP contains Speed recornigion, Speed synthesis, NLG and NLU. NLU and NLG is subsets of NLP. While NLG generate the text, NLU uses text as input and generate some pattern such as Sentiment Analysis, Summary.

The pipeline of NLG

NLG can be divided into 3 phases: Document planning, Microplanning and Realisation. The purpose of Document planning is to chose what to say and the purpos of Microplanning and Realisation is to find how to say. There are some components in each phase. In traditional NLG system, we have 5 components: Content Determination, Text Structure, Aggregation, Lexicalisation, Reffering expression, Realisation.

Content Determination

Content Determination is sets of entities, concepts, relation that we want to talk about in our content. Content determination is the most important part in every NLG engine. It defines the ideas of text and the purpose of context. The input of Contet determination is preporocessed data. NLG engine needs domain knowlede of expert to detect the appropriate information. eg: in the financial commentary, we have to detect the most loss Product. It will determine the reason of P&L loss. Besides the domain knowledge, we also use the experience or use corpus to detect content. Some NLG engine also builds ontology and based on this metatdata to detect content.
There are some approaches for content determination. Basically, we can use rule-based for this one. It is based on some constraint and condition to detect content from preprocessed data. Another approach is using Machine Learning. Some techniques in Machine learning are clustering or classification the data.

Text Structure

Text Structure aims to order the messages from content determination component. It helps to build structure for our generated text. The structure should be consider with these aspects:
  • Group: grouping the text
  • Order: the flow or the text
  • Relation: relation between element in text
There are 2 main approaches for text structure:
  • using Schema
  • Using Rhetorial Structure Theory

Aggregation

Aggregation receives input from Text Structure and refine the input in concrete way. There are some strategy to aggregate the text structure:
  • by conjunction
  • by share participant
  • by shared object
  • embeded properties
NLG egine also uses some approaches for aggregation:
  • by rule-based
  • by Machine Learning
  • by Graph

Lexicalisation

Lexicalisation aims to generate words and syntatic for our generated text. NLG engine considers to Lexicalisation in 2 aspects:
  • Coarse grained lexicalisation
  • Fined grained lexicalisation
The most popular approach for lexicalisaion is based on graph. NLG engine will build a graph to determine word.

Referring expression

Referring expression aims to add more informaiton of entity, concept or relation into generated text. Some approaches of referring expression:
  • init introduction
  • pronoun
  • definite description (explain)

Realisation

Realisation is the final step of NLG pipeline. It helps to genete the text and show meaningful info for user. Realisation mentions about:
  • verb formution
  • structure aggrement
  • syntatically
There are some approach for this component:
  • inversion parser
  • Systemic grammar
  • Meaning-text grammar
  • Template
End To End methodology
There are some researches which try to buid the NLG system in only one component with deeplearning. It means the system does not have several components and long pipeline anymore. what it needs is the input and it will produce the final NLG text or output. It's a reall interesting approach and it has some results in reaserch only. However, there are some limited of this approach:
- the generated text might be not totally correct.
- generating unnecessary text 
- the model needs a lots of data.

Comments

Popular posts from this blog

Introduction to recurrent neural networks

Recurrent neural networks (RNN) is one of the most popular neural networks. If you hear about LSTM ( Long-short term memory), it is one of types of RNN. Specially, the RECURSIVE neural networks is a general of Recurrent neural networks. The different between them is shared weights. In Recursive neural network, shared weights are put in every node, however in recurrent neural networks, shared weights are put through sequences. Problem : Could you know what word will be filled in the sentence: “I like French … ” ?. Let represent the sentence in numberic of words, based on dictionary, we are facing with a sequences problem: predicting the next word given by previous words. RNN does not only dare with sequence problem, It also build a neural network that can remmember. It is exactly what the brain does regularily. Normally, a feedforward neural networks only process information through layers and forget information in t...

Where do variance and bias come from ?

What are variance and bias ? Variance and bias are assertions to evaluate our model based on different datasets. Both of them happen together and we have to find the methodology to trade-off them. A good model is a small variance and bias model.  In wikipedia, we have definitions of variance and bias, formally: The  bias  is an error from erroneous assumptions in the learning  algorithm . The  variance  is an error from sensitivity to small fluctuations in the training set.  (source:  https://en.wikipedia.org/wiki/Bias–variance_tradeoff ) However, I want to make them more normal and practical, so we could understand them as bellowing definitions: Variance asserts fluctuation of precision of model against training data, test data with real data(new data). One model has a hight precision in training and test phase but has low precision with real data, It means this model has hight variance. Hight variance also is called as overfitting: Too...