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

Implement own BERT score #473

Merged
merged 46 commits into from
Aug 30, 2021
Merged
Changes from 1 commit
Commits
Show all changes
46 commits
Select commit Hold shift + click to select a range
f72661a
[WIP] Start adding own BERTScore implementation
stancld Aug 18, 2021
2620b36
[WIP] Prepare the basic backbone for own BERTScore
stancld Aug 18, 2021
a79b091
[WIP] Make working BERTScore with all_layers=True + init bert_score i…
stancld Aug 19, 2021
b145470
Fix cuda device placing
stancld Aug 19, 2021
f1c66b1
Use IDF only if asked
stancld Aug 20, 2021
3b741cb
Add data collators
stancld Aug 20, 2021
6a65526
Add some docs and clean code
stancld Aug 20, 2021
9a1b275
Update docs, write new tests, clean the code
stancld Aug 20, 2021
97f6796
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 20, 2021
f544c70
Fix IDF rescaling and add new tests + fix type
stancld Aug 21, 2021
aec66b1
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 21, 2021
4cd7ea3
Adjust code to work with the DDP plus some changes
stancld Aug 21, 2021
10a63a6
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 21, 2021
8f32421
Fix a bug with tokenizer and add hash_code
stancld Aug 21, 2021
8c68e01
Fix transformers import
stancld Aug 21, 2021
474baf7
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 21, 2021
89b49d8
Fix some mypy, flake8 and logic errors
stancld Aug 21, 2021
d97153e
Add support for the user's own model
stancld Aug 21, 2021
31abcf0
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 21, 2021
af98261
[WIP] Fix error raised by default tokenizer
stancld Aug 21, 2021
3c07bf0
Add support for the rescale with baseline
stancld Aug 22, 2021
a42cdc7
black formatting
stancld Aug 22, 2021
6052525
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 22, 2021
77474ad
Updare requirements + clean a bit
stancld Aug 22, 2021
947fcca
Try to fix recursive-import issue + decrease tqdm version
stancld Aug 22, 2021
50158f1
Merge branch 'master' into own_bert-score
stancld Aug 24, 2021
e20307f
Apply Borda's suggestions
stancld Aug 24, 2021
61506a3
Clean some code + add some docstirngs
stancld Aug 24, 2021
54c492e
Do some refactoring
stancld Aug 24, 2021
1caea8a
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 24, 2021
741f36d
Merge branch 'master' into own_bert-score
stancld Aug 24, 2021
5d198ed
Merge branch 'master' into own_bert-score
stancld Aug 25, 2021
5e24e17
Apply suggestions from code review
Borda Aug 25, 2021
aa3e6a8
Merge branch 'master' into own_bert-score
Borda Aug 26, 2021
cb66482
Apply some borda's suggestions
stancld Aug 26, 2021
1df2bca
Merge branch 'master' into own_bert-score
stancld Aug 26, 2021
e2262d2
[pre-commit.ci] auto fixes from pre-commit.com hooks
pre-commit-ci[bot] Aug 26, 2021
88655b7
Merge verbose/tqdm_available if statements
stancld Aug 26, 2021
eb234c7
Add docstring
stancld Aug 26, 2021
4b12107
Change docstring
stancld Aug 26, 2021
4e5c1da
Merge branch 'master' into own_bert-score
stancld Aug 27, 2021
d0d1419
Run bert-ddp tests only if torch.distributed.is_available()
stancld Aug 27, 2021
9759298
Simplify a condition
stancld Aug 27, 2021
a8dda94
Merge branch 'master' into own_bert-score
mergify[bot] Aug 27, 2021
64e0863
Use smaller model, 'albert-base-v2', for testing because of OOM issues
stancld Aug 27, 2021
f23451e
Set join=False for mp_spawn in the ddp_test
stancld Aug 29, 2021
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
Prev Previous commit
Next Next commit
[pre-commit.ci] auto fixes from pre-commit.com hooks
for more information, see https://pre-commit.ci
  • Loading branch information
pre-commit-ci[bot] committed Aug 24, 2021
commit 1caea8a0654fe1628cba018155b33ff195d8e241
3 changes: 2 additions & 1 deletion torchmetrics/functional/text/bert.py
Original file line number Diff line number Diff line change
Expand Up @@ -138,7 +138,8 @@ def _output_data_collator(model_output: Tensor, attention_mask: Tensor, target_l


class TextDataset(Dataset):
"""PyTorch dataset class for storing tokenized sentences and other properties used for BERT score calculation."""
"""PyTorch dataset class for storing tokenized sentences and other properties used for BERT score
calculation."""

def __init__(
self,
Expand Down