initial commit for wikiser-bert-base
Browse files- README.md +62 -0
- config.json +80 -0
- pytorch_model.bin +3 -0
- special_tokens_map.json +7 -0
- tokenizer.json +0 -0
- tokenizer_config.json +15 -0
- vocab.txt +0 -0
README.md
CHANGED
|
@@ -1,3 +1,65 @@
|
|
| 1 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 2 |
license: apache-2.0
|
| 3 |
---
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
---
|
| 2 |
+
tags:
|
| 3 |
+
- software engineering
|
| 4 |
+
- ner
|
| 5 |
+
- named-entity recognition
|
| 6 |
+
- token-classification
|
| 7 |
+
widget:
|
| 8 |
+
- text: >-
|
| 9 |
+
In 2005, Nokia developed a Linux-based operating system called Maemo, which shipped that year on the Nokia 770 Internet Tablet.
|
| 10 |
+
example_title: example 1
|
| 11 |
+
- text: >-
|
| 12 |
+
The Linux kernel is a widely ported operating system kernela and runs on a highly diverse range of computer architectures, including ARM-based Android smartphones and the IBM Z mainframes.
|
| 13 |
+
example_title: example 2
|
| 14 |
+
- text: >-
|
| 15 |
+
Windows XP was originally bundled with Internet Explorer 6.
|
| 16 |
+
example_title: example 3
|
| 17 |
+
language:
|
| 18 |
+
- en
|
| 19 |
+
datasets:
|
| 20 |
+
- wikiser
|
| 21 |
license: apache-2.0
|
| 22 |
---
|
| 23 |
+
# Software Entity Recognition with Noise-robust Learning
|
| 24 |
+
|
| 25 |
+
We train a BERT model for the task software entity recognition (SER).
|
| 26 |
+
The training data leverages WikiSER, a corpus of 1.7M sentences extracted from Wikipedia.
|
| 27 |
+
The model uses _self-regularization_ during the finetuning process, allowing it to be robust to texts in the software domain, including misannotations, different naming conventions, and others.
|
| 28 |
+
|
| 29 |
+
The model recognizes 12 fine-grained named entities: `Algorithm`, `Application`, `Architecture`, `Data_Structure`, `Device`, `Error_Name`, `General_Concept`, `Language`,
|
| 30 |
+
`Library`, `License`, `Operating_System`, and `Protocol`.
|
| 31 |
+
|
| 32 |
+
## Model details
|
| 33 |
+
|
| 34 |
+
Paper: Coming...
|
| 35 |
+
|
| 36 |
+
Code: https://github.com/taidnguyen/software_entity_recognition
|
| 37 |
+
|
| 38 |
+
Finetuned from model: `bert-base-cased`
|
| 39 |
+
|
| 40 |
+
## How to use
|
| 41 |
+
|
| 42 |
+
```python
|
| 43 |
+
from transformers import AutoTokenizer, AutoModelForTokenClassification
|
| 44 |
+
|
| 45 |
+
tokenizer = AutoTokenizer.from_pretrained("taidng/wikiser-bert-base")
|
| 46 |
+
model = AutoModelForTokenClassification.from_pretrained("taidng/wikiser-bert-base")
|
| 47 |
+
|
| 48 |
+
nlp = pipeline("ner", model=model, tokenizer=tokenizer)
|
| 49 |
+
example = "Windows XP was originally bundled with Internet Explorer 6."
|
| 50 |
+
|
| 51 |
+
ner_results = nlp(example)
|
| 52 |
+
print(ner_results)
|
| 53 |
+
```
|
| 54 |
+
|
| 55 |
+
## Citation
|
| 56 |
+
|
| 57 |
+
```bibtex
|
| 58 |
+
@inproceedings{nguyen2023software,
|
| 59 |
+
title={Software Entity Recognition with Noise-Robust Learning},
|
| 60 |
+
author={Nguyen, Tai and Di, Yifeng and Lee, Joohan and Chen, Muhao and Zhang, Tianyi},
|
| 61 |
+
booktitle={Proceedings of the 38th IEEE/ACM International Conference on Automated Software Engineering (ASE'23)},
|
| 62 |
+
year={2023},
|
| 63 |
+
organization={IEEE/ACM}
|
| 64 |
+
}
|
| 65 |
+
```
|
config.json
ADDED
|
@@ -0,0 +1,80 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"_name_or_path": "bert-base-cased",
|
| 3 |
+
"architectures": [
|
| 4 |
+
"BertForTokenClassification"
|
| 5 |
+
],
|
| 6 |
+
"attention_probs_dropout_prob": 0.1,
|
| 7 |
+
"classifier_dropout": null,
|
| 8 |
+
"gradient_checkpointing": false,
|
| 9 |
+
"hidden_act": "gelu",
|
| 10 |
+
"hidden_dropout_prob": 0.1,
|
| 11 |
+
"hidden_size": 768,
|
| 12 |
+
"id2label": {
|
| 13 |
+
"0": "B-Algorithm",
|
| 14 |
+
"1": "I-Algorithm",
|
| 15 |
+
"2": "B-Application",
|
| 16 |
+
"3": "I-Application",
|
| 17 |
+
"4": "B-Architecture",
|
| 18 |
+
"5": "I-Architecture",
|
| 19 |
+
"6": "B-Data_Structure",
|
| 20 |
+
"7": "I-Data_Structure",
|
| 21 |
+
"8": "B-Device",
|
| 22 |
+
"9": "I-Device",
|
| 23 |
+
"10": "B-Error_Name",
|
| 24 |
+
"11": "I-Error_Name",
|
| 25 |
+
"12": "B-General_Concept",
|
| 26 |
+
"13": "I-General_Concept",
|
| 27 |
+
"14": "B-Language",
|
| 28 |
+
"15": "I-Language",
|
| 29 |
+
"16": "B-Library",
|
| 30 |
+
"17": "I-Library",
|
| 31 |
+
"18": "B-License",
|
| 32 |
+
"19": "I-License",
|
| 33 |
+
"20": "B-Operating_System",
|
| 34 |
+
"21": "I-Operating_System",
|
| 35 |
+
"22": "B-Protocol",
|
| 36 |
+
"23": "I-Protocol",
|
| 37 |
+
"24": "O"
|
| 38 |
+
},
|
| 39 |
+
"initializer_range": 0.02,
|
| 40 |
+
"intermediate_size": 3072,
|
| 41 |
+
"label2id": {
|
| 42 |
+
"B-Algorithm": 0,
|
| 43 |
+
"B-Application": 2,
|
| 44 |
+
"B-Architecture": 4,
|
| 45 |
+
"B-Data_Structure": 6,
|
| 46 |
+
"B-Device": 8,
|
| 47 |
+
"B-Error_Name": 10,
|
| 48 |
+
"B-General_Concept": 12,
|
| 49 |
+
"B-Language": 14,
|
| 50 |
+
"B-Library": 16,
|
| 51 |
+
"B-License": 18,
|
| 52 |
+
"B-Operating_System": 20,
|
| 53 |
+
"B-Protocol": 22,
|
| 54 |
+
"I-Algorithm": 1,
|
| 55 |
+
"I-Application": 3,
|
| 56 |
+
"I-Architecture": 5,
|
| 57 |
+
"I-Data_Structure": 7,
|
| 58 |
+
"I-Device": 9,
|
| 59 |
+
"I-Error_Name": 11,
|
| 60 |
+
"I-General_Concept": 13,
|
| 61 |
+
"I-Language": 15,
|
| 62 |
+
"I-Library": 17,
|
| 63 |
+
"I-License": 19,
|
| 64 |
+
"I-Operating_System": 21,
|
| 65 |
+
"I-Protocol": 23,
|
| 66 |
+
"O": 24
|
| 67 |
+
},
|
| 68 |
+
"layer_norm_eps": 1e-12,
|
| 69 |
+
"max_position_embeddings": 512,
|
| 70 |
+
"model_type": "bert",
|
| 71 |
+
"num_attention_heads": 12,
|
| 72 |
+
"num_hidden_layers": 12,
|
| 73 |
+
"pad_token_id": 0,
|
| 74 |
+
"position_embedding_type": "absolute",
|
| 75 |
+
"torch_dtype": "float32",
|
| 76 |
+
"transformers_version": "4.28.0",
|
| 77 |
+
"type_vocab_size": 2,
|
| 78 |
+
"use_cache": true,
|
| 79 |
+
"vocab_size": 28996
|
| 80 |
+
}
|
pytorch_model.bin
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:4d9a057beb04d3b5d8a793018b2f7bae0c7b77a756d003cc58afd5486038d4fb
|
| 3 |
+
size 431027757
|
special_tokens_map.json
ADDED
|
@@ -0,0 +1,7 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"cls_token": "[CLS]",
|
| 3 |
+
"mask_token": "[MASK]",
|
| 4 |
+
"pad_token": "[PAD]",
|
| 5 |
+
"sep_token": "[SEP]",
|
| 6 |
+
"unk_token": "[UNK]"
|
| 7 |
+
}
|
tokenizer.json
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|
tokenizer_config.json
ADDED
|
@@ -0,0 +1,15 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
{
|
| 2 |
+
"clean_up_tokenization_spaces": true,
|
| 3 |
+
"cls_token": "[CLS]",
|
| 4 |
+
"do_lower_case": false,
|
| 5 |
+
"mask_token": "[MASK]",
|
| 6 |
+
"model_max_length": 512,
|
| 7 |
+
"pad_token": "[PAD]",
|
| 8 |
+
"padding": "max_length",
|
| 9 |
+
"sep_token": "[SEP]",
|
| 10 |
+
"strip_accents": null,
|
| 11 |
+
"tokenize_chinese_chars": true,
|
| 12 |
+
"tokenizer_class": "BertTokenizer",
|
| 13 |
+
"truncation": true,
|
| 14 |
+
"unk_token": "[UNK]"
|
| 15 |
+
}
|
vocab.txt
ADDED
|
The diff for this file is too large to render.
See raw diff
|
|
|