Commit 39a25be
add taskmodules and models from pie-modules (#498)
This PR implements #459, i.e., it adds the models and taskmodules
implemented originally in
[pie-modules](https://github.com/ArneBinder/pie-modules) (except for QA
and span-pair based RE, see potential follow-ups below).
- added models:
- `SequenceClassificationModelWithPooler`
- `SequencePairSimilarityModelWithPooler`
- `SimpleTokenClassificationModel`
- `SimpleGenerativeModel`
- `SimpleSequenceClassificationModel`
- `TokenClassificationModelWithSeq2SeqEncoderAndCrf`
- added taskmodules:
- `RETextClassificationWithIndicesTaskModule`
- `TextToTextTaskModule`
- `LabeledSpanExtractionByTokenClassificationTaskModule`
- `PointerNetworkTaskModuleForEnd2EndRE`
- `CrossTextBinaryCorefTaskModule`
**IMPORTANT: This restricts the version of transformers to
`>=4.35.0,<4.37.0`! So, this is breaking.**
requires:
- #482
- #499
Additional changes:
- add `tabulate`, and `pytorch-crf` to dev dependencies
- set dependence `torchmetrics[text] >=1.5, <2` to solve conflicts with
`nltk` (`text` loads the required additional dependencies and `>=1.5`
ensures that no deprecated nltk models are loaded. Note that we already
use the modern nltk models in
[`pie_documents.document.processing.NltkSentenceSplitter`](https://github.com/ArneBinder/pie-documents/blob/main/src/pie_documents/document/processing/sentence_splitter.py))
- add `SpanNotAlignedWithTokenException` and `get_aligned_token_span` to
`utils.document`
- add `RequiresMaxInputLength` and `RequiresTaskmoduleConfig` to
`models.interface`
potential follow-ups:
- [ ] add remaining models (SimpleExtractiveQuestionAnsweringModel and
SpanTupleClassificationModel)
- [ ] add remaining taskmodules (ExtractiveQuestionAnsweringTaskModule,
and RESpanPairClassificationTaskModule)
---------
Co-authored-by: Danylo Mysak <[email protected]>1 parent a6bb91d commit 39a25be
File tree
77 files changed
+22270
-167
lines changed- src/pytorch_ie
- models
- base_models
- common
- components
- taskmodules
- common
- metrics
- pointer_network
- utils
- tests
- fixtures/taskmodules/cross_text_binary_coref
- models
- base_models
- components
- taskmodules
- common
- metrics
- pointer_network
- utils
Some content is hidden
Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.
77 files changed
+22270
-167
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
2 | 2 | | |
3 | 3 | | |
4 | 4 | | |
5 | | - | |
| 5 | + | |
6 | 6 | | |
7 | 7 | | |
8 | 8 | | |
9 | | - | |
| 9 | + | |
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
21 | 21 | | |
22 | 22 | | |
23 | 23 | | |
24 | | - | |
25 | | - | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
| 27 | + | |
| 28 | + | |
26 | 29 | | |
27 | 30 | | |
28 | 31 | | |
| |||
51 | 54 | | |
52 | 55 | | |
53 | 56 | | |
54 | | - | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
55 | 65 | | |
56 | 66 | | |
57 | 67 | | |
58 | 68 | | |
59 | 69 | | |
60 | 70 | | |
61 | 71 | | |
| 72 | + | |
62 | 73 | | |
63 | 74 | | |
64 | 75 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
1 | 11 | | |
2 | 12 | | |
3 | 13 | | |
| |||
8 | 18 | | |
9 | 19 | | |
10 | 20 | | |
| 21 | + | |
| 22 | + | |
| 23 | + | |
| 24 | + | |
| 25 | + | |
| 26 | + | |
11 | 27 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
| 1 | + | |
| 2 | + | |
0 commit comments