This is a summary of the ideas and work plan for realising knowledge-based natural language processing with links to existing work.
Natural language understanding involves mapping words into a graph model for the meaning of an utterance. The amount and kinds of reasoning involved depends on the context and the agent's current goals. We can distinguish between System 1 (decision trees and analogical reasoning) and System 2 (slower sequential rule-based reasoning).
Common sense reasoning covers a broad range of everyday knowledge including time, space, physical interactions, theory of mind and so forth. This includes causal models, e.g. things fall if they are not supported, and objects can't fit into containers smaller than themselves. Young children learn a lot of this for themselves through play and interacting with others.
Children similarly steadily expand their vocabulary, learning words along with their meaning. New words stimulate System 2 reasoning and updates to the lexicon and taxonomic knowledge. Misunderstandings may occur, be noticed and corrected.
We need to gather a collection of utterances and work on a subset of common sense knowledge sufficient for understanding those utterances. It is not a goal to develop a comprehensive taxonomy of common sense knowledge, and the emphasis is rather on demonstrating human-like understanding, reasoning and learning. Nonetheless, it will be helpful to develop visual tools to support browsing, querying and reasoning, including taxonomic knowledge and the graph models constructed in episodic memory.
People are generally quick to resolve semantic ambiguities in utterances.
- What meaning does this word have in this utterance?
- What is the meaning of this pronoun or noun phrase?
- How does this preposition bind to the phrase structure?
This points to the need for efficient processing to identify (say) whether an adjective is consistent with a particular meaning of the associated noun. In principle, a purely knowledge based approach can be combined with statistical approaches based upon word colocations and a model of attention, e.g. verbs and nouns.
Verbs map to actions or relationships with a flexible set of arguments that are filled by noun phrases and prepositions. The mapping further depends on the focus of the utterance, e.g. Mary bought the book vs The book was bought by Mary. The tense is mapped to temporal annotations, which may refer to another event or interval, e.g. John was doing the washing up when Mary rang the door bell, which describes an activity that was ongoing when another event occurred.
Pronouns and noun phrases either introduce or refer to thing(s). This involves a search through episodic memory that holds the representation of the meaning. Search can also occur through the phrase structure, looking for potential antecedents, e.g. Susan was looking for her door key, where her refers to Susan.
Taxonomic knowledge licenses the use of related words, e.g. "red flowers", given that flowers come in different colours. This can be used to select the most likely meaning of a word that has multiple possible meanings. The processing is incremental, i.e. word by word, and may involve progressive refinement as further evidence is observed. Semantic priming biases the selection of meanings based upon the preceding episodic context. In principle, this can be implemented using spreading activation.
Concepts are based on natural language semantics, and may have fuzzy context dependent meanings. An example is warm
which is relative to hot
, cool
and cold
, rather than to specific temperatures. Fuzzy meanings may be related to functions over a set of things and a given thing may be described as warm
(60%) and cool
(40%). This is connected to human reasoning based upon consideration of a set of examples.
Reasoning involves graph algorithms and rulesets that act over episodic and semantic memory. In principle, these can be described as services as part of taxonomic graphs and invoked as needed. Decision trees modeled as discrimination networks can be used for efficient selection in any given context.
A small set of examples is needed to provide a proof of concept demonstrator for cognitive natural language understanding. This then needs to be followed by a proof of concept demonstrator for cognitive natural language generation, as understanding and generation are closely coupled.
Further background is given in Commonsense Reasoning, a preliminary investigation of how commonsense knowledge and reasoning can be implemented with chunks
This covers some ideas for working on knowledge-based NLP starting with NLU, which involves the following processing model:
- Preprocess text to a sequence of lower case words, stripping punctuation and expanding common abbreviations, using the following word, if necessary, for disambiguation. Apostrophes are retained for candidate possessives.
- Determine the part of speech for the current word using the preceding words and the following word as needed. This uses a small set of rules together with simple statistics, starting from the part of speech tags listed in the lexicon for this word.
- Use the lexicon to identify the candidate word senses for the current word. Each word sense is also associated with the word stem and lexical attributes, e.g. possessive, number and gender. Note that word stems are associated with patterns that predict morphological regularities (word endings).
- Use taxonomic and statistical knowledge to rank the candidate word senses, using the preceding words and the episodic record of their meaning, which is used as part of semantic priming.
- Apply the shift-reduce rules to update the loose syntactic structure for the utterance.
- When reducing the shift-reduce stack, applying knowledge-based processing to a) noun phrases, b) verbs, c) prepositions and d) conjunctions, as appropriate, to build the model of meaning of the utterance in episodic memory.
It isn't practical to codify knowledge for all of the English language, so we need to start by focusing on a small vocabulary that is sufficient for the utterances we want to include in early demonstrators. This potentially includes:
- English language versions of common sense facts and rules
- Examples for demonstrating common sense reasoning with the form: <statement, question, answer>
- Conversational dialogues such as ordering dinner at a restaurant, see existing demo
- Examples of lessons that teach and assess everyday knowledge and skills
A starting point would be to be to explore how taxonomic knowledge can be used to license usage in language, e.g. which adjectives can be used with given nouns. At the same time, it would be helpful to consider the kinds of graph models that are appropriate for representing the meaning of example utterances, and how this relates to the processing of noun phrases, verbs, prepositions and conjunctions.
Other work relates to evolving the syntactic processing, e.g. text pre-processor, part of speech tagger, lexicon, and shift-reduce parser. It may, for instance, make sense to expand the number of part of speech tags if that would simplify processing.
Plenty of work is needed on NLG and the desire to share knowledge across NLU and NLG.
This section considers a small set of example utterances along with the supporting knowledge and reasoning.
the small dog barked at the cat
This involves two kinds of domestic animals. Domestic animals is a distinct category from wild animals. Dogs vary in their size and other characteristics, e.g. colour, short/long fur, raised and floppy ears. A small dog is small relative to the size of dogs overall. Barking is a threat activity by dogs and generally directed to other animals, e.g. humans and cats, that the dog perceives to be intruding on the dog's territory. A territory is an area of land around the dog's home. Many kinds of animals are territorial, and this is motivated by the need to defend resources (mainly food) against competitors. In this example, the activity takes place in the indefinite past. The cat is likely to be upset and frightened by being barked at, and may respond by raising its fur, arching its back and hissing/snarling at the dog. The cat will be ready to run away if the dog runs towards it, otherwise if the cat moves away, the dog will soon stop barking.
This example involves a wide range of common sense knowledge:
- categories of animals and their characteristics
- common animal behaviours
- territories and spatial reasoning
- causal reasoning about behaviours
- events, actions, activities and temporal reasoning
How can this knowledge be modelled using chunk graphs?
the kettle boiled dry
A kettle is used to boil water, e.g. to make tea. Water has different phases: solid (ice), liquid (water) and gas (steam). At atmospheric pressure, water boils at 100 degrees Celcius. The water level drops as the heat supplied to the kettle makes it boil off into steam. When all of the water has boiled off, the temperature of the kettle will rise abruptly risking damaging the kettle. This can be modelled using qualitative reasoning for physical systems. In this example, the kettle needs to be removed from the heat, e.g. by turning off the stove ring it is on, or moving it away from that ring. This relates to knowledge about heating and cooking.