Repository navigation
Expand file tree
/
Copy pathdependencyparser.jade
More file actions
135 lines (103 loc) · 3.16 KB
/
Copy pathdependencyparser.jade
File metadata and controls
135 lines (103 loc) · 3.16 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
//- 💫 DOCS > API > DEPENDENCYPARSER
include ../../_includes/_mixins
p Annotate syntactic dependencies on #[code Doc] objects.
+h(2, "load") DependencyParser.load
+tag classmethod
p Load the statistical model from the supplied path.
+table(["Name", "Type", "Description"])
+row
+cell #[code path]
+cell #[code Path]
+cell The path to load from.
+row
+cell #[code vocab]
+cell #[code Vocab]
+cell The vocabulary. Must be shared by the documents to be processed.
+row
+cell #[code require]
+cell bool
+cell Whether to raise an error if the files are not found.
+footrow
+cell return
+cell #[code DependencyParser]
+cell The newly constructed object.
+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 return
+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 return
+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 yield
+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 return
+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 return
+cell #[code StepwiseState]
+cell A state object, to step through the annotation process.