mirror of
				https://github.com/explosion/spaCy.git
				synced 2025-10-30 23:47:31 +03:00 
			
		
		
		
	
		
			
				
	
	
		
			112 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
			
		
		
	
	
			112 lines
		
	
	
		
			2.6 KiB
		
	
	
	
		
			Plaintext
		
	
	
	
	
	
| //- 💫 DOCS > API > DEPENDENCYPARSER
 | |
| 
 | |
| include ../../_includes/_mixins
 | |
| 
 | |
| p Annotate syntactic dependencies on #[code Doc] objects.
 | |
| 
 | |
| +under-construction
 | |
| 
 | |
| +h(2, "init") DependencyParser.__init__
 | |
|     +tag method
 | |
| 
 | |
| p Create a #[code DependencyParser].
 | |
| 
 | |
| +table(["Name", "Type", "Description"])
 | |
|     +row
 | |
|         +cell #[code vocab]
 | |
|         +cell #[code Vocab]
 | |
|         +cell The vocabulary. Must be shared with documents to be processed.
 | |
| 
 | |
|     +row
 | |
|         +cell #[code model]
 | |
|         +cell #[thinc.linear.AveragedPerceptron]
 | |
|         +cell The statistical model.
 | |
| 
 | |
|     +footrow
 | |
|         +cell returns
 | |
|         +cell #[code DependencyParser]
 | |
|         +cell The newly constructed object.
 | |
| 
 | |
| +h(2, "call") DependencyParser.__call__
 | |
|     +tag method
 | |
| 
 | |
| p
 | |
|     |  Apply the dependency parser, setting the heads and dependency relations
 | |
|     |  onto the #[code Doc] object.
 | |
| 
 | |
| +table(["Name", "Type", "Description"])
 | |
|     +row
 | |
|         +cell #[code doc]
 | |
|         +cell #[code Doc]
 | |
|         +cell The document to be processed.
 | |
| 
 | |
|     +footrow
 | |
|         +cell returns
 | |
|         +cell #[code None]
 | |
|         +cell -
 | |
| 
 | |
| +h(2, "pipe") DependencyParser.pipe
 | |
|     +tag method
 | |
| 
 | |
| p Process a stream of documents.
 | |
| 
 | |
| +table(["Name", "Type", "Description"])
 | |
|     +row
 | |
|         +cell #[code stream]
 | |
|         +cell -
 | |
|         +cell The sequence of documents to process.
 | |
| 
 | |
|     +row
 | |
|         +cell #[code batch_size]
 | |
|         +cell int
 | |
|         +cell The number of documents to accumulate into a working set.
 | |
| 
 | |
|     +row
 | |
|         +cell #[code n_threads]
 | |
|         +cell int
 | |
|         +cell
 | |
|             |  The number of threads with which to work on the buffer in
 | |
|             |  parallel.
 | |
| 
 | |
|     +footrow
 | |
|         +cell yields
 | |
|         +cell #[code Doc]
 | |
|         +cell Documents, in order.
 | |
| 
 | |
| +h(2, "update") DependencyParser.update
 | |
|     +tag method
 | |
| 
 | |
| p Update the statistical model.
 | |
| 
 | |
| +table(["Name", "Type", "Description"])
 | |
|     +row
 | |
|         +cell #[code doc]
 | |
|         +cell #[code Doc]
 | |
|         +cell The example document for the update.
 | |
| 
 | |
|     +row
 | |
|         +cell #[code gold]
 | |
|         +cell #[code GoldParse]
 | |
|         +cell The gold-standard annotations, to calculate the loss.
 | |
| 
 | |
|     +footrow
 | |
|         +cell returns
 | |
|         +cell int
 | |
|         +cell The loss on this example.
 | |
| 
 | |
| +h(2, "step_through") DependencyParser.step_through
 | |
|     +tag method
 | |
| 
 | |
| p Set up a stepwise state, to introspect and control the transition sequence.
 | |
| 
 | |
| +table(["Name", "Type", "Description"])
 | |
|     +row
 | |
|         +cell #[code doc]
 | |
|         +cell #[code Doc]
 | |
|         +cell The document to step through.
 | |
| 
 | |
|     +footrow
 | |
|         +cell returns
 | |
|         +cell #[code StepwiseState]
 | |
|         +cell A state object, to step through the annotation process.
 |