Support prediction for SRL task.#332
Support prediction for SRL task.#332hunterhector merged 3 commits intoasyml:masterfrom Jiaqiang-Ruan:srl_task
Conversation
hunterhector
left a comment
There was a problem hiding this comment.
I cannot fully review this without seeing work and seeing other part of the SRL system. A few comments:
- The code probably hide a little too much, for example, users cannot see the model class anymore
- If this is an real example, we should provide downloadable weights and other things for people to try.
| pl = Pipeline() | ||
| pl.set_reader(reader) | ||
| pl.add(predictor) | ||
| pl.initialize() |
There was a problem hiding this comment.
As an example, it is better to create a writer to write out the results, or show some pack content.
|
|
||
|
|
||
| reader = OntonotesReader() | ||
| saved_model = torch.load("model.pt") |
There was a problem hiding this comment.
Is this just the weights, or the whole model class?
| text_batch=text_tensor, | ||
| text_mask=text_mask, | ||
| srl_features=srl_features) | ||
| print(output) |
There was a problem hiding this comment.
you probably don't want to print this in real production
Codecov Report
@@ Coverage Diff @@
## master #332 +/- ##
=======================================
Coverage 81.13% 81.13%
=======================================
Files 209 209
Lines 14615 14615
=======================================
Hits 11858 11858
Misses 2757 2757 Continue to review full report at Codecov.
|
Description of changes
This PR support the prediction for SRL task. It adds user code built upon extractor framework.
Test Conducted
The code is runnable. But the performance still need to be validated on the small dataset.