transformer-srl
Reimplementation of a BERT based model (Shi et al, 2019), currently the state-of-the-art for English SRL. This model implements also predicate disambiguation.
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
✓Academic publication links
Links to: arxiv.org -
○Committers with academic emails
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (10.3%) to scientific vocabulary
Keywords
Repository
Reimplementation of a BERT based model (Shi et al, 2019), currently the state-of-the-art for English SRL. This model implements also predicate disambiguation.
Basic Info
Statistics
- Stars: 70
- Watchers: 6
- Forks: 9
- Open Issues: 5
- Releases: 8
Topics
Metadata Files
README.md
Semantic Role Lableing with BERT
Semantic Role Labeling based on AllenNLP implementation of Shi et al, 2019. Can be trained using both PropBank and VerbAtlas inventories and implements also the predicate disambiguation task, in addition to arguments identification and disambiguation.
How to use
Install the library
bash
pip install transformer-srl
Pre-trained model
You can also use a pre-trained model. To use it, first install the correct version of transformer-srl:
bash
pip install transformer-srl==2.4.6
then download the pretrained model srl_bert_base_conll2012.tar.gz from here.
| File | Model | Version | F1 Argument | F1 Predicate |
| :---: | :---: | :---: | :---: | :---: |
| srlbertbase_conll2012.tar.gz | bert-base-cased | 2.4.6 | 86.0 | 95.5 |
CLI
bash
echo '{"sentence": "Did Uriah honestly think he could beat the game in under three hours?"}' | \
allennlp predict path/to/srl_bert_base_conll2012.tar.gz - --include-package transformer_srl
Inside Python Code
```python from transformersrl import datasetreaders, models, predictors
predictor = predictors.SrlTransformersPredictor.frompath("path/to/srlbertbaseconll2012.tar.gz, "transformer_srl") predictor.predict( sentence="Did Uriah honestly think he could beat the game in under three hours?" ) ```
Infos
- Language Model: BERT
- Dataset: CoNLL 2012
Results with VerbAtlas
With bert-base-cased:
```
Dev set
- F1 arguments 87.6
- F1 predicates 95.5 # Test set
- F1 arguments x
- F1 predicates x ```
With bert-base-multilingual-cased:
```
Dev set
- F1 arguments 86.2
- F1 predicates 94.2 # Test set
- F1 arguments 86.1
- F1 predicates 94.9 ```
To-Dos
- [x] Works with both PropBank and VerbAtlas (infer inventory from dataset reader)
- [ ] Compatibility with all models from Huggingface's Transformers. - Now works only with models that accept 1 as token type id
- [ ] Predicate identification (without using spacy)
Owner
- Name: Riccardo Orlando
- Login: Riccorl
- Kind: user
- Location: Rome, Italy
- Company: PhD @SapienzaNLP
- Website: riccorl.github.io
- Twitter: RiccardoRicOrl
- Repositories: 12
- Profile: https://github.com/Riccorl
PhD Student at @SapienzaNLP group
Citation (CITATION.cff)
# This CITATION.cff file was generated with cffinit.
# Visit https://bit.ly/cffinit to generate yours today!
cff-version: 1.2.0
title: transformer-srl
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- email: orlandoricc@gmail.com
given-names: Riccardo
family-names: Orlando
GitHub Events
Total
- Watch event: 2
Last Year
- Watch event: 2
Committers
Last synced: about 2 years ago
Top Committers
| Name | Commits | |
|---|---|---|
| Riccardo Orlando | o****c@g****m | 139 |
| Riccardo Orlando | R****l | 8 |
Issues and Pull Requests
Last synced: 7 months ago
All Time
- Total issues: 22
- Total pull requests: 1
- Average time to close issues: 23 days
- Average time to close pull requests: 15 minutes
- Total issue authors: 17
- Total pull request authors: 1
- Average comments per issue: 5.68
- Average comments per pull request: 0.0
- Merged pull requests: 1
- Bot issues: 0
- Bot pull requests: 0
Past Year
- Issues: 0
- Pull requests: 0
- Average time to close issues: N/A
- Average time to close pull requests: N/A
- Issue authors: 0
- Pull request authors: 0
- Average comments per issue: 0
- Average comments per pull request: 0
- Merged pull requests: 0
- Bot issues: 0
- Bot pull requests: 0
Top Authors
Issue Authors
- LeonHammerla (3)
- sev777 (2)
- Zoher15 (2)
- logicReasoner (2)
- egumasa (1)
- KTRosenberg (1)
- pragyakatyayan (1)
- alirezamshi-zz (1)
- Wangpeiyi9979 (1)
- creatorrr (1)
- DavidSorge (1)
- felgaet (1)
- therealhieu (1)
- Suneal (1)
- Lisa-aa (1)
Pull Request Authors
- Riccorl (1)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 1
-
Total downloads:
- pypi 227 last-month
- Total dependent packages: 0
- Total dependent repositories: 1
- Total versions: 74
- Total maintainers: 1
pypi.org: transformer-srl
SRL Transformer model
- Homepage: https://github.com/Riccorl/transformer-srl
- Documentation: https://transformer-srl.readthedocs.io/
- License: MIT License
-
Latest release: 2.5.2
published about 4 years ago
Rankings
Maintainers (1)
Dependencies
- allennlp >=2.0,<2.1
- allennlp_models >=2.0,<2.1
- spacy >=2.3,<2.4