Upload folder using huggingface_hub
Browse files- .gitattributes +4 -0
- LICENSE +112 -0
- README.md +98 -0
- With-Context-Coarse/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.tagger.mdl +3 -0
- With-Context-Coarse/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.vocabs.json +1 -0
- With-Context-Finegrain/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.tagger.mdl +3 -0
- With-Context-Finegrain/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.vocabs.json +1 -0
- Without-Context-Coarse/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.tagger.mdl +3 -0
- Without-Context-Coarse/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.vocabs.json +1 -0
- Without-Context-Finegrain/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.tagger.mdl +3 -0
- Without-Context-Finegrain/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.vocabs.json +1 -0
.gitattributes
CHANGED
|
@@ -33,3 +33,7 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
With-Context-Coarse/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.tagger.mdl filter=lfs diff=lfs merge=lfs -text
|
| 37 |
+
With-Context-Finegrain/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.tagger.mdl filter=lfs diff=lfs merge=lfs -text
|
| 38 |
+
Without-Context-Coarse/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.tagger.mdl filter=lfs diff=lfs merge=lfs -text
|
| 39 |
+
Without-Context-Finegrain/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.tagger.mdl filter=lfs diff=lfs merge=lfs -text
|
LICENSE
ADDED
|
@@ -0,0 +1,112 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
Apache License
|
| 2 |
+
Version 2.0, January 2004
|
| 3 |
+
http://www.apache.org/licenses/
|
| 4 |
+
|
| 5 |
+
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
|
| 6 |
+
|
| 7 |
+
1. Definitions.
|
| 8 |
+
|
| 9 |
+
"License" shall mean the terms and conditions for use, reproduction,
|
| 10 |
+
and distribution as defined by Sections 1 through 9 of this document.
|
| 11 |
+
|
| 12 |
+
"Licensor" shall mean the copyright owner or entity authorized by
|
| 13 |
+
the copyright owner that is granting the License.
|
| 14 |
+
|
| 15 |
+
"Legal Entity" shall mean the union of the acting entity and all other
|
| 16 |
+
entities that control, are controlled by, or are under common control
|
| 17 |
+
with that entity.
|
| 18 |
+
|
| 19 |
+
"Source" form shall mean the preferred form for making modifications,
|
| 20 |
+
including but not limited to software source code, documentation source,
|
| 21 |
+
and configuration files.
|
| 22 |
+
|
| 23 |
+
"Object" form shall mean any form resulting from mechanical transformation
|
| 24 |
+
or translation of a Source form, including but not limited to compiled
|
| 25 |
+
object code, generated documentation, and conversions to other media types.
|
| 26 |
+
|
| 27 |
+
"Work" shall mean the work of authorship, whether in Source or Object form,
|
| 28 |
+
made available under the License, as indicated by a copyright notice that
|
| 29 |
+
is included in or attached to the work.
|
| 30 |
+
|
| 31 |
+
"Derivative Works" shall mean any work, in Source or Object form, that is
|
| 32 |
+
based on (or derived from) the Work and for which the editorial revisions,
|
| 33 |
+
annotations, elaborations, or other modifications represent, as a whole,
|
| 34 |
+
an original work of authorship.
|
| 35 |
+
|
| 36 |
+
"Contribution" shall mean any work of authorship intentionally submitted
|
| 37 |
+
to the Licensor for inclusion in the Work by the copyright owner or by an
|
| 38 |
+
individual or Legal Entity authorized to submit on behalf of the copyright
|
| 39 |
+
owner.
|
| 40 |
+
|
| 41 |
+
"Contributor" shall mean Licensor and any individual or Legal Entity on
|
| 42 |
+
behalf of whom a Contribution has been received by Licensor and subsequently
|
| 43 |
+
incorporated within the Work.
|
| 44 |
+
|
| 45 |
+
2. Grant of Copyright License.
|
| 46 |
+
|
| 47 |
+
Subject to the terms and conditions of this License, each Contributor hereby
|
| 48 |
+
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
| 49 |
+
irrevocable copyright license to reproduce, prepare Derivative Works of,
|
| 50 |
+
publicly display, publicly perform, sublicense, and distribute the Work and
|
| 51 |
+
such Derivative Works in Source or Object form.
|
| 52 |
+
|
| 53 |
+
3. Grant of Patent License.
|
| 54 |
+
|
| 55 |
+
Subject to the terms and conditions of this License, each Contributor hereby
|
| 56 |
+
grants to You a perpetual, worldwide, non-exclusive, no-charge, royalty-free,
|
| 57 |
+
irrevocable (except as stated in this section) patent license to make, have
|
| 58 |
+
made, use, offer to sell, sell, import, and otherwise transfer the Work.
|
| 59 |
+
|
| 60 |
+
4. Redistribution.
|
| 61 |
+
|
| 62 |
+
You may reproduce and distribute copies of the Work or Derivative Works thereof
|
| 63 |
+
in any medium, with or without modifications, provided that You meet the
|
| 64 |
+
following conditions:
|
| 65 |
+
|
| 66 |
+
(a) You must give any other recipients of the Work a copy of this License; and
|
| 67 |
+
(b) You must cause any modified files to carry prominent notices stating that
|
| 68 |
+
You changed the files; and
|
| 69 |
+
(c) You must retain, in the Source form of any Derivative Works that You
|
| 70 |
+
distribute, all copyright, patent, trademark, and attribution notices
|
| 71 |
+
from the Source form of the Work; and
|
| 72 |
+
(d) If the Work includes a "NOTICE" text file, then any Derivative Works that
|
| 73 |
+
You distribute must include a readable copy of the attribution notices
|
| 74 |
+
contained within such NOTICE file.
|
| 75 |
+
|
| 76 |
+
5. Submission of Contributions.
|
| 77 |
+
|
| 78 |
+
Unless You explicitly state otherwise, any Contribution intentionally submitted
|
| 79 |
+
for inclusion in the Work by You to the Licensor shall be under the terms and
|
| 80 |
+
conditions of this License, without any additional terms or conditions.
|
| 81 |
+
|
| 82 |
+
6. Trademarks.
|
| 83 |
+
|
| 84 |
+
This License does not grant permission to use the trade names, trademarks,
|
| 85 |
+
service marks, or product names of the Licensor, except as required for
|
| 86 |
+
describing the origin of the Work and reproducing the content of the NOTICE file.
|
| 87 |
+
|
| 88 |
+
7. Disclaimer of Warranty.
|
| 89 |
+
|
| 90 |
+
Unless required by applicable law or agreed to in writing, Licensor provides the
|
| 91 |
+
Work (and each Contributor provides its Contributions) on an "AS IS" BASIS,
|
| 92 |
+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied,
|
| 93 |
+
including, without limitation, any warranties or conditions of TITLE,
|
| 94 |
+
NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
|
| 95 |
+
|
| 96 |
+
8. Limitation of Liability.
|
| 97 |
+
|
| 98 |
+
In no event and under no legal theory shall any Contributor be liable to You for
|
| 99 |
+
damages, including any direct, indirect, special, incidental, or consequential
|
| 100 |
+
damages of any character arising as a result of this License or out of the use
|
| 101 |
+
or inability to use the Work.
|
| 102 |
+
|
| 103 |
+
9. Accepting Warranty or Additional Liability.
|
| 104 |
+
|
| 105 |
+
While redistributing the Work or Derivative Works thereof, You may choose to offer,
|
| 106 |
+
and charge a fee for, acceptance of support, warranty, indemnity, or other
|
| 107 |
+
liability obligations and/or rights consistent with this License.
|
| 108 |
+
|
| 109 |
+
However, in accepting such obligations, You may act only on Your own behalf and on
|
| 110 |
+
Your sole responsibility, not on behalf of any other Contributor.
|
| 111 |
+
|
| 112 |
+
END OF TERMS AND CONDITIONS
|
README.md
ADDED
|
@@ -0,0 +1,98 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
---
|
| 2 |
+
language: multilingual
|
| 3 |
+
tags:
|
| 4 |
+
- xlm-roberta
|
| 5 |
+
- adapter
|
| 6 |
+
- NER
|
| 7 |
+
- POS
|
| 8 |
+
- dependency-parsing
|
| 9 |
+
- universal-dependencies
|
| 10 |
+
- multi-task
|
| 11 |
+
license: apache-2.0
|
| 12 |
+
|
| 13 |
+
datasets:
|
| 14 |
+
- universal_dependencies
|
| 15 |
+
---
|
| 16 |
+
|
| 17 |
+
# XLM-R Adapter-Based Multitask Model (`customized-mwt-ner`)
|
| 18 |
+
|
| 19 |
+
This repository contains a fine-tuned [XLM-RoBERTa](https://huggingface.co/xlm-roberta-base) model enhanced with task-specific **adapter layers** for multilingual NLP tasks including:
|
| 20 |
+
|
| 21 |
+
- Part-of-Speech tagging (`UPOS`, `XPOS`)
|
| 22 |
+
- Morphological features tagging (`FEATS`)
|
| 23 |
+
- Dependency parsing (`DEPREL`, `HEAD`)
|
| 24 |
+
- Named Entity Recognition (NER)
|
| 25 |
+
|
| 26 |
+
Trained using **adapter-based finetuning** and multi-task supervision on Universal Dependencies and custom NER data.
|
| 27 |
+
|
| 28 |
+
---
|
| 29 |
+
|
| 30 |
+
## Files
|
| 31 |
+
|
| 32 |
+
- `customized-mwt-ner.tagger.mdl`
|
| 33 |
+
→ PyTorch state dict containing task adapter weights and classification heads.
|
| 34 |
+
|
| 35 |
+
- `customized-mwt-ner.vocabs.json`
|
| 36 |
+
→ Token and label vocabulary mappings (used for preprocessing and decoding).
|
| 37 |
+
|
| 38 |
+
---
|
| 39 |
+
|
| 40 |
+
## Model Architecture
|
| 41 |
+
|
| 42 |
+
- Base: `xlm-roberta-base` (frozen)
|
| 43 |
+
- Adapter configuration: [`Pfeiffer`](https://adapterhub.ml/adapters/pfeiffer/)
|
| 44 |
+
- Injected adapter layer per Transformer block
|
| 45 |
+
- Task-specific heads for:
|
| 46 |
+
- POS (`upos`, `xpos`)
|
| 47 |
+
- Morphological features (`feats`)
|
| 48 |
+
- Dependency parsing (`unlabeled`, `deprel`)
|
| 49 |
+
- Optional NER layer (if enabled)
|
| 50 |
+
|
| 51 |
+
---
|
| 52 |
+
|
| 53 |
+
## Usage (PyTorch)
|
| 54 |
+
|
| 55 |
+
You’ll need to:
|
| 56 |
+
1. Load `xlm-roberta-base` from Hugging Face
|
| 57 |
+
2. Load adapter weights from `customized-mwt-ner.tagger.mdl`
|
| 58 |
+
3. Use the vocab file for decoding predictions
|
| 59 |
+
|
| 60 |
+
> NOTE: This model is **not directly plug-and-play** with `transformers` unless you recreate the original architecture and adapter insertion logic.
|
| 61 |
+
|
| 62 |
+
Refer to the [original paper](http://arxiv.org/abs/2310.09501) for complete documentation.
|
| 63 |
+
|
| 64 |
+
---
|
| 65 |
+
|
| 66 |
+
## Variants
|
| 67 |
+
|
| 68 |
+
This model comes in four variants:
|
| 69 |
+
|
| 70 |
+
| Context | Label Granularity | Folder / Repo Name |
|
| 71 |
+
|---------------|-------------------|----------------------------------|
|
| 72 |
+
| With Context | Coarse | `with-context-coarse` |
|
| 73 |
+
| With Context | Fine-grain | `with-context-finegrain` |
|
| 74 |
+
| Without Context | Coarse | `without-context-coarse` |
|
| 75 |
+
| Without Context | Fine-grain | `without-context-finegrain` |
|
| 76 |
+
|
| 77 |
+
---
|
| 78 |
+
|
| 79 |
+
## License
|
| 80 |
+
|
| 81 |
+
APACHE 2.0 License. Please cite appropriately if used in research.
|
| 82 |
+
|
| 83 |
+
---
|
| 84 |
+
|
| 85 |
+
## Citation
|
| 86 |
+
|
| 87 |
+
```bibtex
|
| 88 |
+
@misc{sandhan2023depnecti,
|
| 89 |
+
title={DepNeCTI: Dependency-based Nested Compound Type Identification for Sanskrit},
|
| 90 |
+
author={Jivnesh Sandhan and Yaswanth Narsupalli and Sreevatsa Muppirala and Sriram Krishnan and Pavankumar Satuluri and Amba Kulkarni and Pawan Goyal},
|
| 91 |
+
year={2023},
|
| 92 |
+
eprint={2310.09501},
|
| 93 |
+
archivePrefix={arXiv},
|
| 94 |
+
primaryClass={cs.CL}
|
| 95 |
+
}
|
| 96 |
+
```
|
| 97 |
+
Link to original paper => [HERE](http://arxiv.org/abs/2310.09501)
|
| 98 |
+
Link to DepNeCT Github Repo => [HERE](https://github.com/yaswanth-iitkgp/DepNeCTI)
|
With-Context-Coarse/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.tagger.mdl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:0c237c93f88cdaa64afd93ae6bcb44a125a60c6bcf7773d3f3cd6cdf62bac6f4
|
| 3 |
+
size 12107510
|
With-Context-Coarse/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.vocabs.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"lemma": {"0": 0}, "upos": {"_": 0, "CompNo": 1, "Comp3": 2, "Comp4": 3, "Comp2": 4, "Comp5": 5, "Comp6": 6, "Comp7": 7, "Comp8": 8}, "xpos": {"_": 0}, "feats": {"_": 0}, "head": {"_": 0}, "deprel": {"_": 0, "No_rel": 1, "Tatpurusha": 2, "Comp_root": 3, "root": 4, "Bahuvrihi": 5, "Dvandva": 6, "Avyayibhava": 7}, "deps": {"_": 0}}
|
With-Context-Finegrain/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.tagger.mdl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:7bb4e507f4d26390bea225cc66b1c728a254a7110e7ee611c93f1d0fd11e09f1
|
| 3 |
+
size 21196278
|
With-Context-Finegrain/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.vocabs.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"lemma": {"0": 0}, "upos": {"_": 0, "CompNo": 1, "Comp3": 2, "Comp4": 3, "Comp2": 4, "Comp5": 5, "Comp6": 6, "Comp7": 7, "Comp8": 8}, "xpos": {"_": 0}, "feats": {"_": 0}, "head": {"_": 0}, "deprel": {"_": 0, "No_rel": 1, "T6": 2, "U": 3, "Comp_root": 4, "root": 5, "Bs6": 6, "K1": 7, "Di": 8, "K6": 9, "Ds": 10, "Tn": 11, "Bsmn": 12, "Km": 13, "T4": 14, "T3": 15, "Bs3": 16, "T5": 17, "T7": 18, "K7": 19, "T2": 20, "Bs7": 21, "BvS": 22, "Bb": 23, "Bsp": 24, "Tg": 25, "Bv": 26, "Tdt": 27, "Bss": 28, "Tds": 29, "A1": 30, "K": 31, "K4": 32, "Bsu": 33, "T": 34, "Bs5": 35, "d": 36, "T1": 37, "Tp": 38, "BS6": 39, "Bvs": 40, "BvU": 41, "Tm": 42, "K2": 43, "k1": 44, "Bvp": 45}, "deps": {"_": 0}}
|
Without-Context-Coarse/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.tagger.mdl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a4897c93a4dea587c0a9f4220bb691b079c6026465b873da3b8f7c15aefba60d
|
| 3 |
+
size 11958518
|
Without-Context-Coarse/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.vocabs.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"lemma": {"0": 0}, "upos": {"_": 0, "Comp3": 1, "CompNo": 2, "Comp4": 3, "Comp2": 4, "Comp5": 5, "Comp6": 6, "Comp7": 7, "Comp8": 8}, "xpos": {"_": 0}, "feats": {"_": 0}, "head": {"_": 0}, "deprel": {"_": 0, "Tatpurusha": 1, "Comp_root": 2, "root": 3, "Bahuvrihi": 4, "Dvandva": 5, "Avyayibhava": 6}, "deps": {"_": 0}}
|
Without-Context-Finegrain/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.tagger.mdl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:de7d379e5c6ae8df83a74f3c03607ea6a5bb04fc3c5679cb080bb4475e1b1eed
|
| 3 |
+
size 21047286
|
Without-Context-Finegrain/xlm-roberta-base/customized-mwt-ner/customized-mwt-ner.vocabs.json
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
{"lemma": {"0": 0}, "upos": {"_": 0, "Comp3": 1, "CompNo": 2, "Comp4": 3, "Comp2": 4, "Comp5": 5, "Comp6": 6, "Comp7": 7, "Comp8": 8}, "xpos": {"_": 0}, "feats": {"_": 0}, "head": {"_": 0}, "deprel": {"_": 0, "T6": 1, "U": 2, "Comp_root": 3, "root": 4, "Bs6": 5, "K1": 6, "Di": 7, "K6": 8, "Ds": 9, "Tn": 10, "Bsmn": 11, "Km": 12, "T4": 13, "T3": 14, "Bs3": 15, "T5": 16, "T7": 17, "K7": 18, "T2": 19, "Bs7": 20, "BvS": 21, "Bb": 22, "Bsp": 23, "Tg": 24, "Bv": 25, "Tdt": 26, "Bss": 27, "Tds": 28, "A1": 29, "K": 30, "K4": 31, "Bsu": 32, "T": 33, "Bs5": 34, "d": 35, "T1": 36, "Tp": 37, "BS6": 38, "Bvs": 39, "BvU": 40, "Tm": 41, "K2": 42, "k1": 43, "Bvp": 44}, "deps": {"_": 0}}
|