Skip to content

Commit

Permalink
update transformer token classification taskmodule with version from A…
Browse files Browse the repository at this point in the history
  • Loading branch information
ArneBinder authored Nov 29, 2023
1 parent 5ebd97a commit 4424abe
Show file tree
Hide file tree
Showing 5 changed files with 813 additions and 1,105 deletions.
26 changes: 15 additions & 11 deletions configs/taskmodule/transformer_token_classification.yaml
Original file line number Diff line number Diff line change
@@ -1,14 +1,18 @@
_target_: src.taskmodules.MyTransformerTokenClassificationTaskModule
_target_: src.taskmodules.MyTokenClassificationTaskModule

tokenizer_name_or_path: bert-base-uncased
## Long sequence handling
## example: split the input into windows of 512 tokens that have 64 tokens overlap
# tokenizer_kwargs:
# max_length: 512
# truncation: True
# return_overflowing_tokens: True
# stride: 64
## Alternative to fixed size windowing: use span annotations to partition the input.
## Note, that this requires to add these annotations to the documents beforehand!
## Both methods, fixed size windowing and span annotation partitioning, can be used together.
## example: partition the input with span annotations from the "paragraphs" annotation layer
# partition_annotation: paragraphs

entity_annotation: entities
# Long sequence handling
#max_window: 512
#window_overlap: 64
# Alternative to fixed size windowing: use span annotations to partition the input
# (this requires to add these annotations to the documents beforehand!)
#partition_annotation: paragraphs

# Further parameters (also see the source code of TransformerTokenClassificationTaskModule)
#include_ill_formed_predictions: false
## Further parameters (also see the source code of TransformerTokenClassificationTaskModule)
# include_ill_formed_predictions: false
1 change: 1 addition & 0 deletions requirements.txt
Original file line number Diff line number Diff line change
@@ -1,6 +1,7 @@
# --------- pytorch-ie --------- #
pytorch-ie>=0.28.0,<0.30.0
pie-datasets>=0.7.0,<0.8.0
pie-modules>=0.8.0,<0.9.0

# --------- hydra --------- #
hydra-core>=1.3.0
Expand Down
2 changes: 1 addition & 1 deletion src/taskmodules/__init__.py
Original file line number Diff line number Diff line change
@@ -1 +1 @@
from .transformer_token_classification import MyTransformerTokenClassificationTaskModule
from .transformer_token_classification import MyTokenClassificationTaskModule
Loading

0 comments on commit 4424abe

Please sign in to comment.