jimnoneill commited on
Commit
4facfce
·
verified ·
1 Parent(s): 215354d

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +102 -44
README.md CHANGED
@@ -10,74 +10,132 @@ tags:
10
  - chemistry
11
  - medical
12
  ---
13
-
14
  # CarD-T: Carcinogen Detection via Transformers
15
 
16
  ## Overview
17
-
18
  CarD-T (Carcinogen Detection via Transformers) is a novel text analytics approach that combines transformer-based machine learning with probabilistic statistical analysis to efficiently nominate carcinogens from scientific texts. This model is designed to address the challenges faced by current systems in managing the burgeoning biomedical literature related to carcinogen identification and classification.
19
 
20
  ## Model Details
21
-
22
- - **Architecture**: Based on Bio-ELECTRA, a 335 million parameter language model
23
- - **Training Data**: PubMed abstracts featuring known carcinogens from International Agency for Research on Cancer (IARC) groups G1 and G2A
24
- - **Task**: Named Entity Recognition (NER) for carcinogen identification
25
- - **Performance**:
26
- - Precision: 0.894
27
- - Recall: 0.857
28
- - F1 Score: 0.875
29
 
30
  ## Features
31
-
32
- - Efficient nomination of potential carcinogens from scientific literature
33
- - Context classifier to enhance accuracy and manage computational demands
34
- - Capable of identifying both chemical and non-chemical carcinogenic factors
35
- - Trained on a comprehensive dataset of carcinogen-related abstracts from 2000-2024
 
 
 
 
36
 
37
  ## Use Cases
38
-
39
- - Streamlining toxicogenomic literature reviews
40
- - Identifying potential carcinogens for further investigation
41
- - Augmenting existing carcinogen databases with emerging candidates
42
 
43
  ## Limitations
44
-
45
- - Identifies potential candidates, not confirmed carcinogens
46
- - Analysis limited to abstract-level information
47
- - May be influenced by publication trends and research focus shifts
48
-
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
49
 
50
  ## Citation
51
-
52
  If you use this model in your research, please cite:
53
-
54
  O'Neill, J., Reddy, G.A., Dhillon, N., Tripathi, O., Alexandrov, L., & Katira, P. (2024). CarD-T: Interpreting Carcinomic Lexicon via Transformers. MedRxiv.
55
 
56
  ## License
57
-
58
  MIT License
59
 
60
  Copyright (c) 2024 Jamey O'Neill
61
 
62
- Permission is hereby granted, free of charge, to any person obtaining a copy
63
- of this software and associated documentation files (the "Software"), to deal
64
- in the Software without restriction, including without limitation the rights
65
- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
66
- copies of the Software, and to permit persons to whom the Software is
67
- furnished to do so, subject to the following conditions:
68
 
69
- The above copyright notice and this permission notice shall be included in all
70
- copies or substantial portions of the Software.
71
 
72
- THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
73
- IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
74
- FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
75
- AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
76
- LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
77
- OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
78
- SOFTWARE.
79
 
80
  ## Contact
81
-
82
-
83
  For questions and feedback, please contact Jamey ONeill at joneilliii@sdsu.edu.
 
10
  - chemistry
11
  - medical
12
  ---
 
13
  # CarD-T: Carcinogen Detection via Transformers
14
 
15
  ## Overview
 
16
  CarD-T (Carcinogen Detection via Transformers) is a novel text analytics approach that combines transformer-based machine learning with probabilistic statistical analysis to efficiently nominate carcinogens from scientific texts. This model is designed to address the challenges faced by current systems in managing the burgeoning biomedical literature related to carcinogen identification and classification.
17
 
18
  ## Model Details
19
+ * **Architecture**: Based on Bio-ELECTRA, a 335 million parameter language model
20
+ * **Training Data**: PubMed abstracts featuring known carcinogens from International Agency for Research on Cancer (IARC) groups G1 and G2A
21
+ * **Task**: Named Entity Recognition (NER) for carcinogen identification
22
+ * **Performance**:
23
+ * Precision: 0.894
24
+ * Recall: 0.857
25
+ * F1 Score: 0.875
 
26
 
27
  ## Features
28
+ * Efficient nomination of potential carcinogens from scientific literature
29
+ * Context classifier to enhance accuracy and manage computational demands
30
+ * Capable of identifying both chemical and non-chemical carcinogenic factors
31
+ * Trained on a comprehensive dataset of carcinogen-related abstracts from 2000-2024
32
+ * Recognizes named entities:
33
+ * "carcinogen" (implicated)
34
+ * "negative" (exculpated)
35
+ * "antineoplastic" (cancer protective)
36
+ * "cancertype" (additional metadata such as organism, sex, organ, and virulence)
37
 
38
  ## Use Cases
39
+ * Streamlining toxicogenomic literature reviews
40
+ * Identifying potential carcinogens for further investigation
41
+ * Augmenting existing carcinogen databases with emerging candidates
 
42
 
43
  ## Limitations
44
+ * Identifies potential candidates, not confirmed carcinogens
45
+ * Analysis limited to abstract-level information
46
+ * May be influenced by publication trends and research focus shifts
47
+
48
+ ## Deployment and Usage
49
+
50
+ ### Installation
51
+
52
+ To use the CarD-T model, first install the required dependencies:
53
+
54
+ ```bash
55
+ pip install transformers torch
56
+ ```
57
+
58
+ ### Loading the Model
59
+
60
+ ```python
61
+ from transformers import AutoTokenizer, AutoModelForTokenClassification
62
+
63
+ model_name = "jimnoneill/CarD-T"
64
+ tokenizer = AutoTokenizer.from_pretrained(model_name)
65
+ model = AutoModelForTokenClassification.from_pretrained(model_name)
66
+ ```
67
+
68
+ ### Using the Model for Named Entity Recognition
69
+
70
+ ```python
71
+ def predict_entities(text):
72
+ inputs = tokenizer(text, return_tensors="pt", truncation=True, max_length=512)
73
+ outputs = model(**inputs)
74
+ predictions = outputs.logits.argmax(dim=2)
75
+
76
+ entities = []
77
+ for i, pred in enumerate(predictions[0]):
78
+ if pred != 0: # 0 is typically the 'O' (Outside) label
79
+ entity_type = model.config.id2label[pred.item()]
80
+ word = tokenizer.convert_ids_to_tokens(inputs.input_ids[0][i])
81
+ entities.append((word, entity_type))
82
+
83
+ return entities
84
+
85
+ # Example usage
86
+ text = "Recent studies suggest that compound X may have antineoplastic properties in lung cancer models."
87
+ entities = predict_entities(text)
88
+ print(entities)
89
+ ```
90
+
91
+ ### Processing Metadata
92
+
93
+ ```python
94
+ def process_metadata(text):
95
+ # This is a placeholder function. You would need to implement the logic
96
+ # to extract and process the metadata (organism, sex, organ, virulence)
97
+ # based on your specific requirements and data format.
98
+ pass
99
+
100
+ # Example usage
101
+ metadata = process_metadata(text)
102
+ print(metadata)
103
+ ```
104
+
105
+ ### Full Pipeline Example
106
+
107
+ ```python
108
+ def analyze_text(text):
109
+ entities = predict_entities(text)
110
+ metadata = process_metadata(text)
111
+
112
+ results = {
113
+ "entities": entities,
114
+ "metadata": metadata
115
+ }
116
+
117
+ return results
118
+
119
+ # Example usage
120
+ text = "Recent studies in male rats suggest that compound X may have antineoplastic properties in lung cancer models, while compound Y shows carcinogenic potential in liver cells."
121
+ analysis = analyze_text(text)
122
+ print(analysis)
123
+ ```
124
 
125
  ## Citation
 
126
  If you use this model in your research, please cite:
 
127
  O'Neill, J., Reddy, G.A., Dhillon, N., Tripathi, O., Alexandrov, L., & Katira, P. (2024). CarD-T: Interpreting Carcinomic Lexicon via Transformers. MedRxiv.
128
 
129
  ## License
 
130
  MIT License
131
 
132
  Copyright (c) 2024 Jamey O'Neill
133
 
134
+ Permission is hereby granted, free of charge, to any person obtaining a copy of this software and associated documentation files (the "Software"), to deal in the Software without restriction, including without limitation the rights to use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of the Software, and to permit persons to whom the Software is furnished to do so, subject to the following conditions:
 
 
 
 
 
135
 
136
+ The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software.
 
137
 
138
+ THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
 
 
 
 
 
 
139
 
140
  ## Contact
 
 
141
  For questions and feedback, please contact Jamey ONeill at joneilliii@sdsu.edu.