mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-31 07:57:35 +03:00 
			
		
		
		
	add kb_loader and get_candidates back to EL API
This commit is contained in:
		
							parent
							
								
									e2f2ef3a5a
								
							
						
					
					
						commit
						2dfd919585
					
				|  | @ -622,7 +622,7 @@ others, but may not be as accurate, especially if texts are short. | |||
| 
 | ||||
| An [`EntityLinker`](/api/entitylinker) component disambiguates textual mentions | ||||
| (tagged as named entities) to unique identifiers, grounding the named entities | ||||
| into the "real world". This requires 3 main component | ||||
| into the "real world". This requires 3 main components: | ||||
| 
 | ||||
| - A [`KnowledgeBase`](/api/kb) (KB) holding the unique identifiers, potential | ||||
|   synonyms and prior probabilities. | ||||
|  |  | |||
|  | @ -41,12 +41,13 @@ architectures and their arguments and hyperparameters. | |||
| > ``` | ||||
| 
 | ||||
| | Setting          | Description                                                                                                                                                                                                                                                              | | ||||
| | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||||
| | ---------------- | ------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------ | | ||||
| | `labels_discard` | NER labels that will automatically get a "NIL" prediction. Defaults to `[]`. ~~Iterable[str]~~                                                                                                                                                                           | | ||||
| | `incl_prior`     | Whether or not to include prior probabilities from the KB in the model. Defaults to `True`. ~~bool~~                                                                                                                                                                     | | ||||
| | `incl_context`   | Whether or not to include the local context in the model. Defaults to `True`. ~~bool~~                                                                                                                                                                                   | | ||||
| | `model`          | The [`Model`](https://thinc.ai/docs/api-model) powering the pipeline component. Defaults to [EntityLinker](/api/architectures#EntityLinker). ~~Model~~                                                                                                                   | | ||||
| | `kb`             | The [`KnowledgeBase`](/api/kb). Defaults to [EmptyKB](/api/architectures#EmptyKB), a function returning an empty `KnowledgeBase` with an `entity_vector_length` of `64`. ~~KnowledgeBase~~ | | ||||
| | `kb_loader`      | Function that creates a [`KnowledgeBase`](/api/kb) from a `Vocab` instance. Defaults to [EmptyKB](/api/architectures#EmptyKB), a function returning an empty `KnowledgeBase` with an `entity_vector_length` of `64`. ~~Callable[[Vocab], KnowledgeBase]~~                | | ||||
| | `get_candidates` | Function that generates plausible candidates for a given `Span` object. Defaults to [CandidateGenerator](/api/architectures#CandidateGenerator), a function looking up exact, case-dependent aliases in the KB. ~~Callable[[KnowledgeBase, Span], Iterable[Candidate]]~~ | | ||||
| 
 | ||||
| ```python | ||||
| https://github.com/explosion/spaCy/blob/develop/spacy/pipeline/entity_linker.py | ||||
|  |  | |||
		Loading…
	
		Reference in New Issue
	
	Block a user