mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-30 23:47:31 +03:00 
			
		
		
		
	Document new API [ci skip]
This commit is contained in:
		
							parent
							
								
									39a4741e26
								
							
						
					
					
						commit
						25cb764e64
					
				|  | @ -351,6 +351,24 @@ the two-letter language code. | ||||||
| | `name` | unicode    | Two-letter language code, e.g. `'en'`. | | | `name` | unicode    | Two-letter language code, e.g. `'en'`. | | ||||||
| | `cls`  | `Language` | The language class, e.g. `English`.    | | | `cls`  | `Language` | The language class, e.g. `English`.    | | ||||||
| 
 | 
 | ||||||
|  | ### util.lang_class_is_loaded (#util.lang_class_is_loaded tag="function" new="2.1") | ||||||
|  | 
 | ||||||
|  | Check whether a `Language` class is already loaded. `Language` classes are | ||||||
|  | loaded lazily, to avoid expensive setup code associated with the language data. | ||||||
|  | 
 | ||||||
|  | > #### Example | ||||||
|  | > | ||||||
|  | > ```python | ||||||
|  | > lang_cls = util.get_lang_class("en") | ||||||
|  | > assert util.lang_class_is_loaded("en") is True | ||||||
|  | > assert util.lang_class_is_loaded("de") is False | ||||||
|  | > ``` | ||||||
|  | 
 | ||||||
|  | | Name        | Type    | Description                            | | ||||||
|  | | ----------- | ------- | -------------------------------------- | | ||||||
|  | | `name`      | unicode | Two-letter language code, e.g. `'en'`. | | ||||||
|  | | **RETURNS** | bool    | Whether the class has been loaded.     | | ||||||
|  | 
 | ||||||
| ### util.load_model {#util.load_model tag="function" new="2"} | ### util.load_model {#util.load_model tag="function" new="2"} | ||||||
| 
 | 
 | ||||||
| Load a model from a shortcut link, package or data path. If called with a | Load a model from a shortcut link, package or data path. If called with a | ||||||
|  |  | ||||||
|  | @ -288,11 +288,12 @@ Load state from a binary string. | ||||||
| > assert type(PERSON) == int | > assert type(PERSON) == int | ||||||
| > ``` | > ``` | ||||||
| 
 | 
 | ||||||
| | Name                                 | Type          | Description                                   | | | Name                                          | Type          | Description                                                  | | ||||||
| | ------------------------------------ | ------------- | --------------------------------------------- | | | --------------------------------------------- | ------------- | ------------------------------------------------------------ | | ||||||
| | `strings`                            | `StringStore` | A table managing the string-to-int mapping.   | | | `strings`                                     | `StringStore` | A table managing the string-to-int mapping.                  | | ||||||
| | `vectors` <Tag variant="new">2</Tag> | `Vectors`     | A table associating word IDs to word vectors. | | | `vectors` <Tag variant="new">2</Tag>          | `Vectors`     | A table associating word IDs to word vectors.                | | ||||||
| | `vectors_length`                     | int           | Number of dimensions for each word vector.    | | | `vectors_length`                              | int           | Number of dimensions for each word vector.                   | | ||||||
|  | | `writing_system` <Tag variant="new">2.1</Tag> | dict          | A dict with information about the language's writing system. | | ||||||
| 
 | 
 | ||||||
| ## Serialization fields {#serialization-fields} | ## Serialization fields {#serialization-fields} | ||||||
| 
 | 
 | ||||||
|  |  | ||||||
		Loading…
	
		Reference in New Issue
	
	Block a user