Formal language
A formal language is a set of strings over an alphabet defined by explicit rules for forming valid expressions and, optionally, interpreting them.
Natural Language Processing in Action, Second Edition
A formal language is a language defined by strict rules specifying how valid statements are composed and interpreted.
- How it is used
- Uses strict symbol patterns to recognize commands, trigger actions, and support chatbot dialogue.
- How deep it goes
- Defines grammars, matching, extraction, and finite-state machines, while deferring detailed FSM theory and mathematics.
- Examples
- Uses lock sequences, chatbot greetings, search matching, grep, and pattern-based chatbot systems as concrete examples.
- What you can do after
- Apply it via regular expressions to match phrases, extract information, and trigger scripted responses.
Read how Natural Language Processing in Action, Second Edition explains formal language →
Data Analysis with LLMs
A formal language is a language defined by explicit symbols and grammatical rules for expressing structured statements to computational systems.
- How it is used
- Connects natural-language questions to specialized tools by translating them into tool-specific queries or code.
- How deep it goes
- Explains query translation, database-structure prompts, and query checking, but does not detail language syntax or internals.
- Examples
- Uses a product-review table with review IDs, satisfaction flags, and product categories as a structured-data example.
- What you can do after
- Apply it via a language model to translate a question and database structure into a query, then check the query before execution.
Related concepts
- natural languagecontrasts with · Natural language is a human language that develops through social use and is used for communication, in spoken or written form.
- language modelproduced by · A language model is a computational model that represents patterns in linguistic tokens to estimate sequence probabilities and predict or generate language from context.
- regular expressionuses · A formal pattern notation that describes sets of strings and enables text to be matched, searched, extracted, or transformed.
These guides are generated from the text of Manning books by Manning's knowledge graph and link to the sections they draw on. The full books are available on liveBook and at manning.com.

