Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

update transformer token classification taskmodule #151

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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
Loading