sharkdodo commited on
Commit
21987c0
·
verified ·
1 Parent(s): c20d1a2

Upload folder using huggingface_hub

Browse files
.gitattributes CHANGED
@@ -33,3 +33,4 @@ 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
+ tokenizer.json filter=lfs diff=lfs merge=lfs -text
README.md ADDED
@@ -0,0 +1,200 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ # Indic-Bert-NER-Model
2
+
3
+ A fine-tuned Named Entity Recognition (NER) model based on [AI4Bharat's Indic-BERT](https://huggingface.co/ai4bharat/indic-bert) for extracting medical and regulatory entities from Indian language documents.
4
+
5
+ ## Model Details
6
+
7
+ ### Overview
8
+ This model is fine-tuned for NER tasks on medical and regulatory documents, specifically for identifying entities in adverse event reports and regulatory submissions. It extends the multilingual Indic-BERT base model with specialized training on pharmaceutical and medical regulatory terminology.
9
+
10
+ ### Model Architecture
11
+ - **Base Model**: [ai4bharat/indic-bert](https://huggingface.co/ai4bharat/indic-bert)
12
+ - **Task**: Token Classification (Named Entity Recognition)
13
+ - **Languages Supported**: Indian languages (Hindi, Tamil, Telugu, Kannada, Malayalam, Bengali, and others)
14
+ - **Framework**: PyTorch / Transformers
15
+
16
+ ### Model Specifications
17
+ - **Model Type**: BERT for token classification
18
+ - **Tokenizer**: SentencePiece
19
+ - **Max Sequence Length**: 512 tokens
20
+ - **Hidden Size**: 768
21
+ - **Number of Attention Heads**: 12
22
+ - **Number of Layers**: 12
23
+
24
+ ## Training Data
25
+
26
+ The model was trained on the **Indic-Bert-NER-BIO-Dataset**, which includes:
27
+ - Annotated medical and pharmaceutical regulatory documents
28
+ - Multiple data sources: CTRI, FAERS, JSL datasets
29
+ - Phase 2 augmented and merged datasets for improved robustness
30
+ - BIO (Begin-Inside-Outside) tagged entities
31
+
32
+ For detailed dataset information, see: [Indic-Bert-NER-BIO-Dataset](https://huggingface.co/datasets/redpanda/Indic-Bert-NER-BIO-Dataset)
33
+
34
+ ## Supported Entity Tags
35
+
36
+ The model recognizes the following entity categories:
37
+ - **Medical Entities**: Drug names, diseases, medical conditions
38
+ - **Regulatory Entities**: Dosages, routes of administration, adverse events
39
+ - **Document Entities**: Document types, regulatory references
40
+
41
+ Complete entity taxonomy available in the dataset repository.
42
+
43
+ ## Usage
44
+
45
+ ### Installation
46
+
47
+ ```bash
48
+ pip install transformers torch
49
+ ```
50
+
51
+ ### Basic Usage
52
+
53
+ ```python
54
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
55
+ from transformers import pipeline
56
+
57
+ # Load model and tokenizer
58
+ model_name = "redpanda/Indic-Bert-NER-Model"
59
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
60
+ model = AutoModelForTokenClassification.from_pretrained(model_name)
61
+
62
+ # Create NER pipeline
63
+ ner_pipeline = pipeline(
64
+ "token-classification",
65
+ model=model,
66
+ tokenizer=tokenizer,
67
+ aggregation_strategy="simple"
68
+ )
69
+
70
+ # Example text
71
+ text = "This drug is made from paracetamol and is used for headache treatment."
72
+
73
+ # Perform NER
74
+ results = ner_pipeline(text)
75
+ print(results)
76
+ ```
77
+
78
+ ### Advanced Usage with Custom Labels
79
+
80
+ ```python
81
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
82
+ import torch
83
+
84
+ model_name = "redpanda/Indic-Bert-NER-Model"
85
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
86
+ model = AutoModelForTokenClassification.from_pretrained(model_name)
87
+
88
+ text = "The drug dosage is 500 milligrams daily."
89
+ inputs = tokenizer(text, return_tensors="pt", truncation=True, padding=True)
90
+
91
+ # Get predictions
92
+ outputs = model(**inputs)
93
+ predictions = torch.argmax(outputs.logits, dim=2)
94
+
95
+ # Map predictions to labels
96
+ id2label = model.config.id2label
97
+ tokens = tokenizer.convert_ids_to_tokens(inputs["input_ids"][0])
98
+
99
+ for token, pred in zip(tokens, predictions[0].numpy()):
100
+ print(f"{token}: {id2label[pred]}")
101
+ ```
102
+
103
+ ### Batch Processing
104
+
105
+ ```python
106
+ from transformers import pipeline
107
+
108
+ ner = pipeline(
109
+ "token-classification",
110
+ model="redpanda/Indic-Bert-NER-Model",
111
+ aggregation_strategy="simple"
112
+ )
113
+
114
+ texts = [
115
+ "Paracetamol is commonly used to treat headaches and fever.",
116
+ "Take Ibuprofen 400 milligrams tablet for pain relief."
117
+ ]
118
+
119
+ results = [ner(text) for text in texts]
120
+ for text, entities in zip(texts, results):
121
+ print(f"Text: {text}")
122
+ print(f"Entities: {entities}\n")
123
+ ```
124
+
125
+ ## Model Card
126
+
127
+ ### Model Use
128
+ **Intended Use**: Named Entity Recognition for medical and regulatory documents in Indian languages.
129
+
130
+ **Primary Users**:
131
+ - Healthcare professionals
132
+ - Regulatory compliance teams
133
+ - Medical document processors
134
+ - Adverse event monitoring systems
135
+
136
+ ### Limitations
137
+ - Model trained primarily on English-transliterated Indian languages and Hindi
138
+ - Performance may vary on regional language variations
139
+ - Best performance on well-formatted documents
140
+ - Trained on specific pharmaceutical and regulatory domain
141
+
142
+ ### Ethical Considerations
143
+ - Use only for legitimate regulatory and medical purposes
144
+ - Ensure data privacy compliance when processing sensitive health information
145
+ - Do not use for automated decision-making in clinical settings without human review
146
+ - Respect patient confidentiality and HIPAA/DPDP compliance
147
+
148
+ ## License
149
+
150
+ This model is released under the **MIT License**.
151
+
152
+ ```
153
+ MIT License
154
+
155
+ Copyright (c) 2026 CDSCO & ARIP Contributors
156
+
157
+ Permission is hereby granted, free of charge, to any person obtaining a copy
158
+ of this software and associated documentation files (the "Software"), to deal
159
+ in the Software without restriction, including without limitation the rights
160
+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
161
+ copies of the Software, and to permit persons to whom the Software is
162
+ furnished to do so, subject to the following conditions:
163
+
164
+ The above copyright notice and this permission notice shall be included in all
165
+ copies or substantial portions of the Software.
166
+ ```
167
+
168
+ ## Citation
169
+
170
+ If you use this model in your research or application, please cite:
171
+
172
+ ```bibtex
173
+ @model{indic_bert_ner_2026,
174
+ title = {Indic-Bert-NER-Model},
175
+ author = {CDSCO & ARIP Contributors},
176
+ year = {2026},
177
+ url = {https://huggingface.co/redpanda/Indic-Bert-NER-Model},
178
+ note = {Fine-tuned from AI4Bharat's Indic-BERT}
179
+ }
180
+ ```
181
+
182
+ ## Related Resources
183
+
184
+ - **Base Model**: [AI4Bharat Indic-BERT](https://huggingface.co/ai4bharat/indic-bert)
185
+ - **Dataset**: [Indic-Bert-NER-BIO-Dataset](https://huggingface.co/datasets/redpanda/Indic-Bert-NER-BIO-Dataset)
186
+ - **Training Code**: [ARIP Repository](https://github.com/your-org/arip-platform)
187
+ - **Documentation**: [ARIP Platform Docs](https://github.com/your-org/arip-platform/tree/main/docs)
188
+
189
+ ## Support & Feedback
190
+
191
+ For issues, questions, or feedback:
192
+ - Open an issue on [GitHub](https://github.com/your-org/arip-platform/issues)
193
+ - Contact: CDSCO & ARIP Team
194
+
195
+ ## Changelog
196
+
197
+ ### Version 1.0 (April 2026)
198
+ - Initial release
199
+ - Fine-tuned on Phase 2 augmented dataset
200
+ - Support for Indian languages via Indic-BERT base
config.json ADDED
@@ -0,0 +1,150 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "architectures": [
3
+ "AlbertForTokenClassification"
4
+ ],
5
+ "attention_probs_dropout_prob": 0,
6
+ "bos_token_id": 2,
7
+ "classifier_dropout_prob": 0.1,
8
+ "down_scale_factor": 1,
9
+ "dtype": "float32",
10
+ "embedding_size": 128,
11
+ "eos_token_id": 3,
12
+ "gap_size": 0,
13
+ "hidden_act": "gelu",
14
+ "hidden_dropout_prob": 0,
15
+ "hidden_size": 768,
16
+ "id2label": {
17
+ "0": "B-AADHAAR",
18
+ "1": "B-ABHA",
19
+ "2": "B-ADDRESS_FULL",
20
+ "3": "B-ADVERSE_EVENT",
21
+ "4": "B-AGE",
22
+ "5": "B-CTRI_NUMBER",
23
+ "6": "B-DATE_DOB",
24
+ "7": "B-DATE_GENERIC",
25
+ "8": "B-DIAGNOSIS",
26
+ "9": "B-DRUG_DOSE",
27
+ "10": "B-DRUG_NAME",
28
+ "11": "B-DRUG_ROUTE",
29
+ "12": "B-EC_REG_NUMBER",
30
+ "13": "B-EMAIL",
31
+ "14": "B-LICENSE_NUMBER",
32
+ "15": "B-LOCATION_CITY",
33
+ "16": "B-LOCATION_PINCODE",
34
+ "17": "B-LOCATION_STATE",
35
+ "18": "B-MRN",
36
+ "19": "B-ORG_CRO",
37
+ "20": "B-ORG_EC",
38
+ "21": "B-ORG_HOSPITAL",
39
+ "22": "B-ORG_SPONSOR",
40
+ "23": "B-OUTCOME",
41
+ "24": "B-PAN",
42
+ "25": "B-PERSON_GENERIC",
43
+ "26": "B-PERSON_INVESTIGATOR",
44
+ "27": "B-PERSON_PATIENT",
45
+ "28": "B-PHONE_IN",
46
+ "29": "B-PROTOCOL_NUMBER",
47
+ "30": "B-SEVERITY",
48
+ "31": "B-SITE_CODE",
49
+ "32": "B-VITAL_SIGN",
50
+ "33": "I-AADHAAR",
51
+ "34": "I-ABHA",
52
+ "35": "I-ADDRESS_FULL",
53
+ "36": "I-ADVERSE_EVENT",
54
+ "37": "I-AGE",
55
+ "38": "I-DIAGNOSIS",
56
+ "39": "I-DRUG_DOSE",
57
+ "40": "I-DRUG_NAME",
58
+ "41": "I-EC_REG_NUMBER",
59
+ "42": "I-LOCATION_STATE",
60
+ "43": "I-ORG_CRO",
61
+ "44": "I-ORG_EC",
62
+ "45": "I-ORG_HOSPITAL",
63
+ "46": "I-ORG_SPONSOR",
64
+ "47": "I-OUTCOME",
65
+ "48": "I-PAN",
66
+ "49": "I-PERSON_GENERIC",
67
+ "50": "I-PERSON_INVESTIGATOR",
68
+ "51": "I-PERSON_PATIENT",
69
+ "52": "I-PHONE_IN",
70
+ "53": "I-PROTOCOL_NUMBER",
71
+ "54": "I-SEVERITY",
72
+ "55": "I-VITAL_SIGN",
73
+ "56": "O"
74
+ },
75
+ "initializer_range": 0.02,
76
+ "inner_group_num": 1,
77
+ "intermediate_size": 3072,
78
+ "label2id": {
79
+ "B-AADHAAR": 0,
80
+ "B-ABHA": 1,
81
+ "B-ADDRESS_FULL": 2,
82
+ "B-ADVERSE_EVENT": 3,
83
+ "B-AGE": 4,
84
+ "B-CTRI_NUMBER": 5,
85
+ "B-DATE_DOB": 6,
86
+ "B-DATE_GENERIC": 7,
87
+ "B-DIAGNOSIS": 8,
88
+ "B-DRUG_DOSE": 9,
89
+ "B-DRUG_NAME": 10,
90
+ "B-DRUG_ROUTE": 11,
91
+ "B-EC_REG_NUMBER": 12,
92
+ "B-EMAIL": 13,
93
+ "B-LICENSE_NUMBER": 14,
94
+ "B-LOCATION_CITY": 15,
95
+ "B-LOCATION_PINCODE": 16,
96
+ "B-LOCATION_STATE": 17,
97
+ "B-MRN": 18,
98
+ "B-ORG_CRO": 19,
99
+ "B-ORG_EC": 20,
100
+ "B-ORG_HOSPITAL": 21,
101
+ "B-ORG_SPONSOR": 22,
102
+ "B-OUTCOME": 23,
103
+ "B-PAN": 24,
104
+ "B-PERSON_GENERIC": 25,
105
+ "B-PERSON_INVESTIGATOR": 26,
106
+ "B-PERSON_PATIENT": 27,
107
+ "B-PHONE_IN": 28,
108
+ "B-PROTOCOL_NUMBER": 29,
109
+ "B-SEVERITY": 30,
110
+ "B-SITE_CODE": 31,
111
+ "B-VITAL_SIGN": 32,
112
+ "I-AADHAAR": 33,
113
+ "I-ABHA": 34,
114
+ "I-ADDRESS_FULL": 35,
115
+ "I-ADVERSE_EVENT": 36,
116
+ "I-AGE": 37,
117
+ "I-DIAGNOSIS": 38,
118
+ "I-DRUG_DOSE": 39,
119
+ "I-DRUG_NAME": 40,
120
+ "I-EC_REG_NUMBER": 41,
121
+ "I-LOCATION_STATE": 42,
122
+ "I-ORG_CRO": 43,
123
+ "I-ORG_EC": 44,
124
+ "I-ORG_HOSPITAL": 45,
125
+ "I-ORG_SPONSOR": 46,
126
+ "I-OUTCOME": 47,
127
+ "I-PAN": 48,
128
+ "I-PERSON_GENERIC": 49,
129
+ "I-PERSON_INVESTIGATOR": 50,
130
+ "I-PERSON_PATIENT": 51,
131
+ "I-PHONE_IN": 52,
132
+ "I-PROTOCOL_NUMBER": 53,
133
+ "I-SEVERITY": 54,
134
+ "I-VITAL_SIGN": 55,
135
+ "O": 56
136
+ },
137
+ "layer_norm_eps": 1e-12,
138
+ "max_position_embeddings": 512,
139
+ "model_type": "albert",
140
+ "net_structure_type": 0,
141
+ "num_attention_heads": 12,
142
+ "num_hidden_groups": 1,
143
+ "num_hidden_layers": 12,
144
+ "num_memory_blocks": 0,
145
+ "pad_token_id": 0,
146
+ "position_embedding_type": "absolute",
147
+ "transformers_version": "4.57.6",
148
+ "type_vocab_size": 2,
149
+ "vocab_size": 200000
150
+ }
model.safetensors ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:ec46315a23d419169d0e1d08ab7ce7c87b5926d22c459dadaa4938630fbc6dee
3
+ size 131590588
special_tokens_map.json ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "bos_token": "[CLS]",
3
+ "cls_token": "[CLS]",
4
+ "eos_token": "[SEP]",
5
+ "mask_token": {
6
+ "content": "[MASK]",
7
+ "lstrip": true,
8
+ "normalized": false,
9
+ "rstrip": false,
10
+ "single_word": false
11
+ },
12
+ "pad_token": "<pad>",
13
+ "sep_token": "[SEP]",
14
+ "unk_token": "<unk>"
15
+ }
spiece.model ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:3a1173c2b6e144a02c001e289a05b5dbefddf247c50d4dcf42633158b2968fcb
3
+ size 5646064
tokenizer.json ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:6a5325addfc3b3851d746035d0fb75e3efd3d53e000a05e0ca79cc1df5cb954c
3
+ size 15285686
tokenizer_config.json ADDED
@@ -0,0 +1,59 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ {
2
+ "added_tokens_decoder": {
3
+ "0": {
4
+ "content": "<pad>",
5
+ "lstrip": false,
6
+ "normalized": false,
7
+ "rstrip": false,
8
+ "single_word": false,
9
+ "special": true
10
+ },
11
+ "1": {
12
+ "content": "<unk>",
13
+ "lstrip": false,
14
+ "normalized": false,
15
+ "rstrip": false,
16
+ "single_word": false,
17
+ "special": true
18
+ },
19
+ "2": {
20
+ "content": "[CLS]",
21
+ "lstrip": false,
22
+ "normalized": false,
23
+ "rstrip": false,
24
+ "single_word": false,
25
+ "special": true
26
+ },
27
+ "3": {
28
+ "content": "[SEP]",
29
+ "lstrip": false,
30
+ "normalized": false,
31
+ "rstrip": false,
32
+ "single_word": false,
33
+ "special": true
34
+ },
35
+ "4": {
36
+ "content": "[MASK]",
37
+ "lstrip": true,
38
+ "normalized": false,
39
+ "rstrip": false,
40
+ "single_word": false,
41
+ "special": true
42
+ }
43
+ },
44
+ "bos_token": "[CLS]",
45
+ "clean_up_tokenization_spaces": false,
46
+ "cls_token": "[CLS]",
47
+ "do_lower_case": true,
48
+ "eos_token": "[SEP]",
49
+ "extra_special_tokens": {},
50
+ "keep_accents": true,
51
+ "mask_token": "[MASK]",
52
+ "model_max_length": 1000000000000000019884624838656,
53
+ "pad_token": "<pad>",
54
+ "remove_space": true,
55
+ "sep_token": "[SEP]",
56
+ "sp_model_kwargs": {},
57
+ "tokenizer_class": "AlbertTokenizer",
58
+ "unk_token": "<unk>"
59
+ }
training_args.bin ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:830db2bf011be7a2281886b3573b9ffe271985c931a7ee03176a7e0f90c360c9
3
+ size 5432