- 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.get_lang_class
As the name implies, this function is used to import and load a Language class. It will return a Language class for which, we also add a custom language code using util.set_lang_class function.
Argument
The table below explains its argument −
NAME | TYPE | DESCRIPTION |
---|---|---|
lang | unicode | It will be a two-letter language code. For example, ‘de’ for German. |
Example
An example for util.get_lang_class() function is as follows −
import spacy for language_id in ["de"]: language_class = spacy.util.get_lang_class(language_id) language = language_class() language
Output
The output is mentioned below −
<spacy.lang.de.German at 0x207b96b0dd8>
spacy_util_get_data_path.htm
Advertisements
To Continue Learning Please Login
Login with Google