- spaCy Tutorial
- spaCy - Home
- spaCy - Introduction
- spaCy - Getting Started
- spaCy - Models and Languages
- spaCy - Architecture
- spaCy - Command Line Helpers
- spaCy - Top-level Functions
- spaCy - Visualization Function
- spaCy - Utility Functions
- spaCy - Compatibility Functions
- spaCy - Containers
- Doc Class ContextManager and Property
- spaCy - Container Token Class
- spaCy - Token Properties
- spaCy - Container Span Class
- spaCy - Span Class Properties
- spaCy - Container Lexeme Class
- Training Neural Network Model
- Updating Neural Network Model
- spaCy Useful Resources
- spaCy - Quick Guide
- spaCy - Useful Resources
- spaCy - Discussion
spaCy - Util.update_exc
As the name suggests, this function will update, validate, and overwrite tokenizer expectations. We can also use it to combine the global exceptions with custom, language-specific exceptions.
Arguments
The table below explains its arguments −
NAME | TYPE | DESCRIPTION |
---|---|---|
base_exceptions | Dict | It represents the base tokenizer exceptions. |
addition_dicts | Dicts | These are the exception dictionaries that should be added to the base exceptions in order. |
Example
An example of util.update_exc() function is as follows −
import spacy BASE = {"a.": [{ORTH: "a."}], ":)": [{ORTH: ":)"}]} NEW = {"a.": [{ORTH: "a.", NORM: "all"}]} exceptions_to_add = spacy.util.update_exc(BASE, NEW)
Output
You will see the following output −
This is Tutorialspoint.com!
spacy_util_get_data_path.htm
Advertisements
To Continue Learning Please Login
Login with Google