jedick commited on
Commit
908a00f
Β·
1 Parent(s): 9b489f6

Update examples

Browse files
app.py CHANGED
@@ -1,11 +1,12 @@
1
  import pandas as pd
2
  import gradio as gr
 
 
3
  from retrieval import retrieve_from_pdf
 
4
 
5
  if gr.NO_RELOAD:
6
- from transformers import pipeline
7
  # Resource punkt_tab not found during application startup on HF spaces
8
- import nltk
9
  nltk.download("punkt_tab")
10
 
11
  # Keep track of the model name in a global variable so correct model is shown after page refresh
@@ -17,45 +18,6 @@ if gr.NO_RELOAD:
17
  )
18
 
19
 
20
- def query_model(claim, evidence):
21
- """
22
- Get prediction for a pair of claim and evidence
23
- """
24
- prediction = {
25
- # Send a dictionary containing {"text", "text_pair"} keys; use top_k=3 to get results for all classes
26
- # https://huggingface.co/docs/transformers/v4.51.3/en/main_classes/pipelines#transformers.TextClassificationPipeline.__call__.inputs
27
- # Put evidence before claim
28
- # https://github.com/jedick/ML-capstone-project
29
- # Output {label: confidence} dictionary format as expected by gr.Label()
30
- # https://github.com/gradio-app/gradio/issues/11170
31
- d["label"]: d["score"]
32
- for d in pipe({"text": evidence, "text_pair": claim}, top_k=3)
33
- }
34
- # Return two instances of the prediction to send to different Gradio components
35
- return prediction, prediction
36
-
37
-
38
- def query_model_for_examples(claim, evidence):
39
- """
40
- A duplicate of the previous function, used to keep the API names clean
41
- """
42
- prediction = {
43
- d["label"]: d["score"]
44
- for d in pipe({"text": evidence, "text_pair": claim}, top_k=3)
45
- }
46
- return prediction, prediction
47
-
48
-
49
- # Function to select the model
50
- def select_model(model_name):
51
- global pipe, MODEL_NAME
52
- MODEL_NAME = model_name
53
- pipe = pipeline(
54
- "text-classification",
55
- model=MODEL_NAME,
56
- )
57
-
58
-
59
  def prediction_to_df(prediction=None):
60
  """
61
  Convert prediction text to DataFrame for barplot
@@ -88,16 +50,6 @@ def prediction_to_df(prediction=None):
88
  return df.reset_index(names="Class")
89
 
90
 
91
- def change_visualization(choice):
92
- if choice == "barplot":
93
- barplot = gr.update(visible=True)
94
- label = gr.update(visible=False)
95
- elif choice == "label":
96
- barplot = gr.update(visible=False)
97
- label = gr.update(visible=True)
98
- return barplot, label
99
-
100
-
101
  # Setup theme without background image
102
  my_theme = gr.Theme.from_hub("NoCrypt/miku")
103
  my_theme.set(body_background_fill="#FFFFFF", body_background_fill_dark="#000000")
@@ -112,51 +64,33 @@ with gr.Blocks(theme=my_theme) as demo:
112
  gr.Markdown(
113
  """
114
  # AI4citations
115
- ## Scientific citation verification
116
 
117
- *Press Enter in a textbox or click Submit to run the model.*
 
 
 
 
118
  """
119
  )
120
  gr.Markdown(
121
  """
122
- ### Three ways to use this app
123
 
124
- 1. **Claim verification**: Input a claim and evidence
125
- 2. **Evidence retrieval**: Input a claim to get evidence from PDF
126
- 3. **Claim extraction**: Input a text to get claim from text
 
 
127
  """
128
  )
129
- # Create dropdown menu to select the model
130
- dropdown = gr.Dropdown(
131
- choices=[
132
- # TODO: For bert-base-uncased, how can we set num_labels = 2 in HF pipeline?
133
- # (num_labels is available in AutoModelForSequenceClassification.from_pretrained)
134
- # "bert-base-uncased",
135
- "MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli",
136
- "jedick/DeBERTa-v3-base-mnli-fever-anli-scifact-citint",
137
- ],
138
- value=MODEL_NAME,
139
- label="Model",
140
- )
141
  claim = gr.Textbox(
142
- label="Claim",
143
  info="aka hypothesis",
144
  placeholder="Input claim or use Get Claim from Text",
145
  )
146
- evidence = gr.TextArea(
147
- label="Evidence",
148
- info="aka premise",
149
- placeholder="Input evidence or use Get Evidence from PDF",
150
- )
151
  with gr.Row():
152
- with gr.Accordion("Get Claim from Text", open=False):
153
- text = gr.TextArea(
154
- label="Text",
155
- placeholder="Under construction!",
156
- interactive=False,
157
- )
158
- with gr.Accordion("Get Evidence from PDF", open=False):
159
- pdf_file = gr.File(label="Upload PDF", type="filepath")
160
  get_evidence = gr.Button(value="Get Evidence")
161
  top_k = gr.Slider(
162
  1,
@@ -166,10 +100,14 @@ with gr.Blocks(theme=my_theme) as demo:
166
  interactive=True,
167
  label="Top k sentences",
168
  )
169
- submit = gr.Button("Submit")
 
 
 
 
 
170
 
171
  with gr.Column(scale=2):
172
- radio = gr.Radio(["barplot", "label"], value="barplot", label="Results")
173
  # Keep the prediction textbox hidden
174
  with gr.Accordion(visible=False):
175
  prediction = gr.Textbox(label="Prediction")
@@ -181,42 +119,54 @@ with gr.Blocks(theme=my_theme) as demo:
181
  color_map={"SUPPORT": "green", "NEI": "#888888", "REFUTE": "#FF8888"},
182
  inputs=prediction,
183
  y_lim=([0, 1]),
 
184
  )
185
- label = gr.Label(visible=False)
 
 
 
 
 
 
 
 
 
 
 
 
 
 
186
  with gr.Accordion("Examples", open=False):
187
- gr.Markdown(
188
- "*Prediction performance with jedick/DeBERTa-v3-base-mnli-fever-anli-scifact-citint:*"
189
- ),
190
  with gr.Row():
191
- gr.Examples(
192
- examples="examples/accurate",
 
 
 
 
 
 
 
 
 
193
  inputs=[claim, evidence],
194
- outputs=[prediction, label],
195
- fn=query_model_for_examples,
196
- label="Accurate",
197
- run_on_click=True,
198
- example_labels=pd.read_csv("examples/accurate/log.csv")[
199
  "label"
200
  ].tolist(),
201
  )
202
- gr.Examples(
203
- examples="examples/inaccurate",
 
204
  inputs=[claim, evidence],
205
- outputs=[prediction, label],
206
- fn=query_model_for_examples,
207
- label="Inaccurate",
208
- run_on_click=True,
209
- example_labels=pd.read_csv("examples/inaccurate/log.csv")[
210
  "label"
211
  ].tolist(),
212
  )
213
- gr.Examples(
214
  examples="examples/retrieval",
215
- inputs=[pdf_file, claim],
216
- outputs=evidence,
217
- fn=retrieve_from_pdf,
218
  label="Retrieval",
219
- run_on_click=False,
220
  example_labels=pd.read_csv("examples/retrieval/log.csv")[
221
  "label"
222
  ].tolist(),
@@ -224,7 +174,7 @@ with gr.Blocks(theme=my_theme) as demo:
224
  gr.Markdown(
225
  """
226
  ### Sources
227
- - ML project: [jedick/ML-capstone-project](https://github.com/jedick/ML-capstone-project)
228
  - App repository: [jedick/AI4citations](https://github.com/jedick/AI4citations)
229
  - Fine-tuned model: [jedick/DeBERTa-v3-base-mnli-fever-anli-scifact-citint](https://huggingface.co/jedick/DeBERTa-v3-base-mnli-fever-anli-scifact-citint)
230
  - Datasets used for fine-tuning
@@ -233,9 +183,74 @@ with gr.Blocks(theme=my_theme) as demo:
233
  - Base model: [MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli](https://huggingface.co/MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli)
234
  - Evidence retrieval: [xhluca/bm25s](https://github.com/xhluca/bm25s)
235
  - Gradio theme: [NoCrypt/miku](https://huggingface.co/spaces/NoCrypt/miku)
 
236
  """
237
  )
238
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
239
  # Event listeners
240
 
241
  # Click the submit button or press Enter to submit
@@ -246,18 +261,54 @@ with gr.Blocks(theme=my_theme) as demo:
246
  outputs=[prediction, label],
247
  )
248
 
249
- # Clear the previous predictions when the model is changed
250
  gr.on(
251
- triggers=[dropdown.select],
252
- fn=lambda: "Model changed! Waiting for updated predictions...",
253
- outputs=[prediction],
 
 
 
 
 
254
  api_name=False,
255
  )
256
 
257
- # Update the predictions after changing the model
258
- dropdown.change(
259
- fn=select_model,
260
- inputs=dropdown,
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
261
  ).then(
262
  fn=query_model,
263
  inputs=[claim, evidence],
@@ -265,12 +316,23 @@ with gr.Blocks(theme=my_theme) as demo:
265
  api_name=False,
266
  )
267
 
268
- # Get evidence from PDF
269
  gr.on(
270
- triggers=[pdf_file.upload, get_evidence.click],
 
 
 
 
 
271
  fn=retrieve_from_pdf,
272
  inputs=[pdf_file, claim, top_k],
273
  outputs=evidence,
 
 
 
 
 
 
274
  )
275
 
276
  # Change visualization
@@ -281,4 +343,26 @@ with gr.Blocks(theme=my_theme) as demo:
281
  api_name=False,
282
  )
283
 
284
- demo.launch()
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  import pandas as pd
2
  import gradio as gr
3
+ from transformers import pipeline
4
+ import nltk
5
  from retrieval import retrieve_from_pdf
6
+ import os
7
 
8
  if gr.NO_RELOAD:
 
9
  # Resource punkt_tab not found during application startup on HF spaces
 
10
  nltk.download("punkt_tab")
11
 
12
  # Keep track of the model name in a global variable so correct model is shown after page refresh
 
18
  )
19
 
20
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
21
  def prediction_to_df(prediction=None):
22
  """
23
  Convert prediction text to DataFrame for barplot
 
50
  return df.reset_index(names="Class")
51
 
52
 
 
 
 
 
 
 
 
 
 
 
53
  # Setup theme without background image
54
  my_theme = gr.Theme.from_hub("NoCrypt/miku")
55
  my_theme.set(body_background_fill="#FFFFFF", body_background_fill_dark="#000000")
 
64
  gr.Markdown(
65
  """
66
  # AI4citations
 
67
 
68
+ ### Usage:
69
+
70
+ 1. Input a **Claim**
71
+ 2. Input **Evidence** statements
72
+ - *Optional:* Upload a PDF and click Get Evidence
73
  """
74
  )
75
  gr.Markdown(
76
  """
77
+ ## *AI-powered citation verification*
78
 
79
+ ### To make predictions:
80
+
81
+ - Hit 'Enter' in the **Claim** text box,
82
+ - Hit 'Shift-Enter' in the **Evidence** text box, or
83
+ - Click Get Evidence
84
  """
85
  )
 
 
 
 
 
 
 
 
 
 
 
 
86
  claim = gr.Textbox(
87
+ label="1. Claim",
88
  info="aka hypothesis",
89
  placeholder="Input claim or use Get Claim from Text",
90
  )
 
 
 
 
 
91
  with gr.Row():
92
+ with gr.Accordion("Get Evidence from PDF", open=True):
93
+ pdf_file = gr.File(label="Upload PDF", type="filepath", height=120)
 
 
 
 
 
 
94
  get_evidence = gr.Button(value="Get Evidence")
95
  top_k = gr.Slider(
96
  1,
 
100
  interactive=True,
101
  label="Top k sentences",
102
  )
103
+ evidence = gr.TextArea(
104
+ label="2. Evidence",
105
+ info="aka premise",
106
+ placeholder="Input evidence or use Get Evidence from PDF",
107
+ )
108
+ submit = gr.Button("3. Submit", visible=False)
109
 
110
  with gr.Column(scale=2):
 
111
  # Keep the prediction textbox hidden
112
  with gr.Accordion(visible=False):
113
  prediction = gr.Textbox(label="Prediction")
 
119
  color_map={"SUPPORT": "green", "NEI": "#888888", "REFUTE": "#FF8888"},
120
  inputs=prediction,
121
  y_lim=([0, 1]),
122
+ visible=False,
123
  )
124
+ label = gr.Label()
125
+ with gr.Accordion("Settings", open=False):
126
+ # Create dropdown menu to select the model
127
+ dropdown = gr.Dropdown(
128
+ choices=[
129
+ # TODO: For bert-base-uncased, how can we set num_labels = 2 in HF pipeline?
130
+ # (num_labels is available in AutoModelForSequenceClassification.from_pretrained)
131
+ # "bert-base-uncased",
132
+ "MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli",
133
+ "jedick/DeBERTa-v3-base-mnli-fever-anli-scifact-citint",
134
+ ],
135
+ value=MODEL_NAME,
136
+ label="Model",
137
+ )
138
+ radio = gr.Radio(["label", "barplot"], value="label", label="Results")
139
  with gr.Accordion("Examples", open=False):
140
+ gr.Markdown("*Examples are run when clicked*"),
 
 
141
  with gr.Row():
142
+ support_example = gr.Examples(
143
+ examples="examples/Support",
144
+ label="Support",
145
+ inputs=[claim, evidence],
146
+ example_labels=pd.read_csv("examples/Support/log.csv")[
147
+ "label"
148
+ ].tolist(),
149
+ )
150
+ nei_example = gr.Examples(
151
+ examples="examples/NEI",
152
+ label="NEI",
153
  inputs=[claim, evidence],
154
+ example_labels=pd.read_csv("examples/NEI/log.csv")[
 
 
 
 
155
  "label"
156
  ].tolist(),
157
  )
158
+ refute_example = gr.Examples(
159
+ examples="examples/Refute",
160
+ label="Refute",
161
  inputs=[claim, evidence],
162
+ example_labels=pd.read_csv("examples/Refute/log.csv")[
 
 
 
 
163
  "label"
164
  ].tolist(),
165
  )
166
+ retrieval_example = gr.Examples(
167
  examples="examples/retrieval",
 
 
 
168
  label="Retrieval",
169
+ inputs=[pdf_file, claim],
170
  example_labels=pd.read_csv("examples/retrieval/log.csv")[
171
  "label"
172
  ].tolist(),
 
174
  gr.Markdown(
175
  """
176
  ### Sources
177
+ - ML engineering project: [jedick/MLE-capstone-project](https://github.com/jedick/MLE-capstone-project)
178
  - App repository: [jedick/AI4citations](https://github.com/jedick/AI4citations)
179
  - Fine-tuned model: [jedick/DeBERTa-v3-base-mnli-fever-anli-scifact-citint](https://huggingface.co/jedick/DeBERTa-v3-base-mnli-fever-anli-scifact-citint)
180
  - Datasets used for fine-tuning
 
183
  - Base model: [MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli](https://huggingface.co/MoritzLaurer/DeBERTa-v3-base-mnli-fever-anli)
184
  - Evidence retrieval: [xhluca/bm25s](https://github.com/xhluca/bm25s)
185
  - Gradio theme: [NoCrypt/miku](https://huggingface.co/spaces/NoCrypt/miku)
186
+ - Examples: [MNLI (Poirot)](https://huggingface.co/datasets/nyu-mll/multi_nli/viewer/default/train?row=37&views%5B%5D=train), [CRISPR (evidence)](https://en.wikipedia.org/wiki/CRISPR)
187
  """
188
  )
189
 
190
+ # Functions
191
+
192
+ def query_model(claim, evidence):
193
+ """
194
+ Get prediction for a claim and evidence pair
195
+ """
196
+ prediction = {
197
+ # Send a dictionary containing {"text", "text_pair"} keys; use top_k=3 to get results for all classes
198
+ # https://huggingface.co/docs/transformers/v4.51.3/en/main_classes/pipelines#transformers.TextClassificationPipeline.__call__.inputs
199
+ # Put evidence before claim
200
+ # https://github.com/jedick/MLE-capstone-project
201
+ # Output {label: confidence} dictionary format as expected by gr.Label()
202
+ # https://github.com/gradio-app/gradio/issues/11170
203
+ d["label"]: d["score"]
204
+ for d in pipe({"text": evidence, "text_pair": claim}, top_k=3)
205
+ }
206
+ # Return two instances of the prediction to send to different Gradio components
207
+ return prediction, prediction
208
+
209
+ def use_model(model_name):
210
+ """
211
+ Use the specified model
212
+ """
213
+ global pipe, MODEL_NAME
214
+ MODEL_NAME = model_name
215
+ pipe = pipeline(
216
+ "text-classification",
217
+ model=MODEL_NAME,
218
+ )
219
+
220
+ def change_visualization(choice):
221
+ if choice == "barplot":
222
+ barplot = gr.update(visible=True)
223
+ label = gr.update(visible=False)
224
+ elif choice == "label":
225
+ barplot = gr.update(visible=False)
226
+ label = gr.update(visible=True)
227
+ return barplot, label
228
+
229
+ # From gradio/client/python/gradio_client/utils.py
230
+ def is_http_url_like(possible_url) -> bool:
231
+ """
232
+ Check if the given value is a string that looks like an HTTP(S) URL.
233
+ """
234
+ if not isinstance(possible_url, str):
235
+ return False
236
+ return possible_url.startswith(("http://", "https://"))
237
+
238
+ def select_example(value, evt: gr.EventData):
239
+ # Get the PDF file and claim from the event data
240
+ claim, evidence = value[1]
241
+ # Add the directory path
242
+ return claim, evidence
243
+
244
+ def select_retrieval_example(value, evt: gr.EventData):
245
+ """
246
+ Get the PDF file and claim from the event data.
247
+ """
248
+ pdf_file, claim = value[1]
249
+ # Add the directory path
250
+ if not is_http_url_like(pdf_file):
251
+ pdf_file = f"examples/retrieval/{pdf_file}"
252
+ return pdf_file, claim
253
+
254
  # Event listeners
255
 
256
  # Click the submit button or press Enter to submit
 
261
  outputs=[prediction, label],
262
  )
263
 
264
+ # Get evidence from PDF and run the model
265
  gr.on(
266
+ triggers=[get_evidence.click],
267
+ fn=retrieve_from_pdf,
268
+ inputs=[pdf_file, claim, top_k],
269
+ outputs=evidence,
270
+ ).then(
271
+ fn=query_model,
272
+ inputs=[claim, evidence],
273
+ outputs=[prediction, label],
274
  api_name=False,
275
  )
276
 
277
+ # Handle "Support" examples
278
+ gr.on(
279
+ triggers=[support_example.dataset.select],
280
+ fn=select_example,
281
+ inputs=support_example.dataset,
282
+ outputs=[claim, evidence],
283
+ api_name=False,
284
+ ).then(
285
+ fn=query_model,
286
+ inputs=[claim, evidence],
287
+ outputs=[prediction, label],
288
+ api_name=False,
289
+ )
290
+
291
+ # Handle "NEI" examples
292
+ gr.on(
293
+ triggers=[nei_example.dataset.select],
294
+ fn=select_example,
295
+ inputs=nei_example.dataset,
296
+ outputs=[claim, evidence],
297
+ api_name=False,
298
+ ).then(
299
+ fn=query_model,
300
+ inputs=[claim, evidence],
301
+ outputs=[prediction, label],
302
+ api_name=False,
303
+ )
304
+
305
+ # Handle "Refute" examples
306
+ gr.on(
307
+ triggers=[refute_example.dataset.select],
308
+ fn=select_example,
309
+ inputs=refute_example.dataset,
310
+ outputs=[claim, evidence],
311
+ api_name=False,
312
  ).then(
313
  fn=query_model,
314
  inputs=[claim, evidence],
 
316
  api_name=False,
317
  )
318
 
319
+ # Handle evidence retrieval examples: get evidence from PDF and run the model
320
  gr.on(
321
+ triggers=[retrieval_example.dataset.select],
322
+ fn=select_retrieval_example,
323
+ inputs=retrieval_example.dataset,
324
+ outputs=[pdf_file, claim],
325
+ api_name=False,
326
+ ).then(
327
  fn=retrieve_from_pdf,
328
  inputs=[pdf_file, claim, top_k],
329
  outputs=evidence,
330
+ api_name=False,
331
+ ).then(
332
+ fn=query_model,
333
+ inputs=[claim, evidence],
334
+ outputs=[prediction, label],
335
+ api_name=False,
336
  )
337
 
338
  # Change visualization
 
343
  api_name=False,
344
  )
345
 
346
+ # Clear the previous predictions when the model is changed
347
+ gr.on(
348
+ triggers=[dropdown.select],
349
+ fn=lambda: "Model changed! Waiting for updated predictions...",
350
+ outputs=[prediction],
351
+ api_name=False,
352
+ )
353
+
354
+ # Change the model the update the predictions
355
+ dropdown.change(
356
+ fn=use_model,
357
+ inputs=dropdown,
358
+ ).then(
359
+ fn=query_model,
360
+ inputs=[claim, evidence],
361
+ outputs=[prediction, label],
362
+ api_name=False,
363
+ )
364
+
365
+
366
+ if __name__ == "__main__":
367
+ # allowed_paths is needed to upload PDFs from specific example directory
368
+ demo.launch(allowed_paths=[f"{os.getcwd()}/examples/retrieval"])
examples/NEI/log.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ claim,evidence,label
2
+ "0-dimensional biomaterials lack inductive properties.","Nanotechnologies are emerging platforms that could be useful in measuring, understanding, and manipulating stem cells. Examples include magnetic nanoparticles and quantum dots for stem cell labeling and in vivo tracking; nanoparticles, carbon nanotubes, and polyplexes for the intracellular delivery of genes/oligonucleotides and protein/peptides; and engineered nanometer-scale scaffolds for stem cell differentiation and transplantation. This review examines the use of nanotechnologies for stem cell tracking, differentiation, and transplantation. We further discuss their utility and the potential concerns regarding their cytotoxicity.",SciFact
3
+ "This high AMP/ATP ratio activates the phosphorylation of AMPK, a master energy sensor within cell, and then pAMPK inhibits mTOR signaling by activating TSC2 and subsequently inhibiting Rheb","When electron transport function is inhibited, the ATP synthase can function in reverse such that it uses ATP generated by glycolysis to pump protons across the inner mitochondrial membrane, maintaining membrane potential (Appleby et al., 1999). This latter hypothesis has been questioned as cancer cells have the ability to survive on ATP produced exclusively by glycolysis. The ATP synthase inhibitor, Oligomycin A, diminished TMRE fluorescence in Control-HCT 116 p53βˆ’/βˆ’ cells treated with metformin suggesting that in the presence of metformin, intact cells maintain their mitochondrial membrane potential by reversal of the ATP synthase (Figure 4E). Metformin inhibits cellular proliferation and pro- proliferative signaling via complex I inhibition. It is likely that metformin acts upstream of this site, inhibiting complex I activity while also inhibiting ROS generation.",CitInt
examples/Refute/log.csv ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ claim,evidence,label
2
+ "Poirot was now back and I was sorry that he would take over what I now considered my own investigation.","Poirot, I exclaimed, with relief, and seizing him by both hands, I dragged him into the room.",MNLI
3
+ "1 in 5 million in UK have abnormal PrP positivity.","OBJECTIVES To carry out a further survey of archived appendix samples to understand better the differences between existing estimates of the prevalence of subclinical infection with prions after the bovine spongiform encephalopathy epizootic and to see whether a broader birth cohort was affected, and to understand better the implications for the management of blood and blood products and for the handling of surgical instruments. DESIGN Irreversibly unlinked and anonymised large scale survey of archived appendix samples. SETTING Archived appendix samples from the pathology departments of 41 UK hospitals participating in the earlier survey, and additional hospitals in regions with lower levels of participation in that survey. SAMPLE 32,441 archived appendix samples fixed in formalin and embedded in paraffin and tested for the presence of abnormal prion protein (PrP). RESULTS Of the 32,441 appendix samples 16 were positive for abnormal PrP, indicating an overall prevalence of 493 per million population (95% confidence interval 282 to 801 per million). The prevalence in those born in 1941-60 (733 per million, 269 to 1596 per million) did not differ significantly from those born between 1961 and 1985 (412 per million, 198 to 758 per million) and was similar in both sexes and across the three broad geographical areas sampled. Genetic testing of the positive specimens for the genotype at PRNP codon 129 revealed a high proportion that were valine homozygous compared with the frequency in the normal population, and in stark contrast with confirmed clinical cases of vCJD, all of which were methionine homozygous at PRNP codon 129. CONCLUSIONS This study corroborates previous studies and suggests a high prevalence of infection with abnormal PrP, indicating vCJD carrier status in the population compared with the 177 vCJD cases to date. These findings have important implications for the management of blood and blood products and for the handling of surgical instruments.",SciFact
examples/{accurate β†’ Support}/log.csv RENAMED
@@ -1,7 +1,3 @@
1
  claim,evidence,label
2
- "Poirot was now back and I was sorry that he would take over what I now considered my own investigation.","Poirot, I exclaimed, with relief, and seizing him by both hands, I dragged him into the room.","REFUTE (MNLI)"
3
- "0-dimensional biomaterials lack inductive properties.","Nanotechnologies are emerging platforms that could be useful in measuring, understanding, and manipulating stem cells. Examples include magnetic nanoparticles and quantum dots for stem cell labeling and in vivo tracking; nanoparticles, carbon nanotubes, and polyplexes for the intracellular delivery of genes/oligonucleotides and protein/peptides; and engineered nanometer-scale scaffolds for stem cell differentiation and transplantation. This review examines the use of nanotechnologies for stem cell tracking, differentiation, and transplantation. We further discuss their utility and the potential concerns regarding their cytotoxicity.","NEI (SciFact)"
4
- "1 in 5 million in UK have abnormal PrP positivity.","OBJECTIVES To carry out a further survey of archived appendix samples to understand better the differences between existing estimates of the prevalence of subclinical infection with prions after the bovine spongiform encephalopathy epizootic and to see whether a broader birth cohort was affected, and to understand better the implications for the management of blood and blood products and for the handling of surgical instruments. DESIGN Irreversibly unlinked and anonymised large scale survey of archived appendix samples. SETTING Archived appendix samples from the pathology departments of 41 UK hospitals participating in the earlier survey, and additional hospitals in regions with lower levels of participation in that survey. SAMPLE 32,441 archived appendix samples fixed in formalin and embedded in paraffin and tested for the presence of abnormal prion protein (PrP). RESULTS Of the 32,441 appendix samples 16 were positive for abnormal PrP, indicating an overall prevalence of 493 per million population (95% confidence interval 282 to 801 per million). The prevalence in those born in 1941-60 (733 per million, 269 to 1596 per million) did not differ significantly from those born between 1961 and 1985 (412 per million, 198 to 758 per million) and was similar in both sexes and across the three broad geographical areas sampled. Genetic testing of the positive specimens for the genotype at PRNP codon 129 revealed a high proportion that were valine homozygous compared with the frequency in the normal population, and in stark contrast with confirmed clinical cases of vCJD, all of which were methionine homozygous at PRNP codon 129. CONCLUSIONS This study corroborates previous studies and suggests a high prevalence of infection with abnormal PrP, indicating vCJD carrier status in the population compared with the 177 vCJD cases to date. These findings have important implications for the management of blood and blood products and for the handling of surgical instruments.","REFUTE (SciFact)"
5
- "32% of liver transplantation programs required patients to discontinue methadone treatment in 2001.","ContextChronic hepatitis C is the leading cause for liver transplantation in the United States. Intravenous drug use, the major risk factor, accounts for approximately 60% of hepatitis C virus transmission. Information from the United Network of Organ Sharing (UNOS) does not address substance use among liver transplantation patients. ObjectiveTo identify addiction-related criteria for admission to the UNOS liver transplantation waiting list and posttransplantation problems experienced by patients who are prescribed maintenance methadone. Design, Setting, and ParticipantsMail survey of all 97 adult US liver transplantation programs (belonging to UNOS) in March 2000 with telephone follow-up conducted in May and June 2000.Main Outcome MeasuresPrograms' acceptance and management of patients with past or present substance use disorder. ResultsOf the 97 programs surveyed, 87 (90%) responded. All accept applicants with a history of alcoholism or other addictions, including heroin dependence. Eighty-eight percent of the responding programs require at least 6 months of abstinence from alcohol; 83% from illicit drugs. Ninety-four percent have addiction treatment requirements. Consultations from substance abuse specialists are obtained by 86%. Patients receiving methadone maintenance are accepted by 56% of the responding programs. Approximately 180 patients receiving methadone maintenance are reported to have undergone liver transplantation. ConclusionsMost liver transplantation programs have established policies for patients with substance use disorders. Opiate-dependent patients receiving opiate replacement therapy seem underrepresented in transplantation programs. Little anecdotal evidence for negative impact of opiate replacement therapy on liver transplantation outcome was found. Policies requiring discontinuation of methadone in 32% of all programs contradict the evidence base for efficacy of long-term replacement therapies and potentially result in relapse of previously stable patients.","SUPPORT (SciFact)"
6
- "Several studies have also shown the association of non-coding RNAs in colorectal carcinogenesis through the stimulation or inhibition of apoptosis, cell proliferation, differentiation, invasion and metastasis","Accumulating evidence indicates that lncRNAs could play a critical role in regulation of cellular processes such as cell growth and apoptosis as well as cancer progression and metastasis. In colon cancer, a recent report indicated that miR-211 promotes cell proliferation, tumor growth and cell migration of HCT-116 cells. Although they are less well characterized compared with small non- coding microRNAs (1–5), increasing evidence suggests that lncRNAs could play a critical role in regulation of diverse cellular processes such as stem cell pluripotency, development, cell growth and apoptosis and cancer metastasis (6–13). For example, miR-211 enhances the proliferation, migration and anchorage-independent colony formation of oral carcinoma cells (35). Alterations in the primary structure, secondary structure and expression levels of lncRNAs as well as their cognate RNA-binding proteins are often associated with human diseases, in particular cancer (36).","SUPPORT (CitInt)"
7
- "This high AMP/ATP ratio activates the phosphorylation of AMPK, a master energy sensor within cell, and then pAMPK inhibits mTOR signaling by activating TSC2 and subsequently inhibiting Rheb","When electron transport function is inhibited, the ATP synthase can function in reverse such that it uses ATP generated by glycolysis to pump protons across the inner mitochondrial membrane, maintaining membrane potential (Appleby et al., 1999). This latter hypothesis has been questioned as cancer cells have the ability to survive on ATP produced exclusively by glycolysis. The ATP synthase inhibitor, Oligomycin A, diminished TMRE fluorescence in Control-HCT 116 p53βˆ’/βˆ’ cells treated with metformin suggesting that in the presence of metformin, intact cells maintain their mitochondrial membrane potential by reversal of the ATP synthase (Figure 4E). Metformin inhibits cellular proliferation and pro- proliferative signaling via complex I inhibition. It is likely that metformin acts upstream of this site, inhibiting complex I activity while also inhibiting ROS generation.","NEI (CitInt)"
 
1
  claim,evidence,label
2
+ "32% of liver transplantation programs required patients to discontinue methadone treatment in 2001.","ContextChronic hepatitis C is the leading cause for liver transplantation in the United States. Intravenous drug use, the major risk factor, accounts for approximately 60% of hepatitis C virus transmission. Information from the United Network of Organ Sharing (UNOS) does not address substance use among liver transplantation patients. ObjectiveTo identify addiction-related criteria for admission to the UNOS liver transplantation waiting list and posttransplantation problems experienced by patients who are prescribed maintenance methadone. Design, Setting, and ParticipantsMail survey of all 97 adult US liver transplantation programs (belonging to UNOS) in March 2000 with telephone follow-up conducted in May and June 2000.Main Outcome MeasuresPrograms' acceptance and management of patients with past or present substance use disorder. ResultsOf the 97 programs surveyed, 87 (90%) responded. All accept applicants with a history of alcoholism or other addictions, including heroin dependence. Eighty-eight percent of the responding programs require at least 6 months of abstinence from alcohol; 83% from illicit drugs. Ninety-four percent have addiction treatment requirements. Consultations from substance abuse specialists are obtained by 86%. Patients receiving methadone maintenance are accepted by 56% of the responding programs. Approximately 180 patients receiving methadone maintenance are reported to have undergone liver transplantation. ConclusionsMost liver transplantation programs have established policies for patients with substance use disorders. Opiate-dependent patients receiving opiate replacement therapy seem underrepresented in transplantation programs. Little anecdotal evidence for negative impact of opiate replacement therapy on liver transplantation outcome was found. Policies requiring discontinuation of methadone in 32% of all programs contradict the evidence base for efficacy of long-term replacement therapies and potentially result in relapse of previously stable patients.",SciFact
3
+ "Several studies have also shown the association of non-coding RNAs in colorectal carcinogenesis through the stimulation or inhibition of apoptosis, cell proliferation, differentiation, invasion and metastasis","Accumulating evidence indicates that lncRNAs could play a critical role in regulation of cellular processes such as cell growth and apoptosis as well as cancer progression and metastasis. In colon cancer, a recent report indicated that miR-211 promotes cell proliferation, tumor growth and cell migration of HCT-116 cells. Although they are less well characterized compared with small non- coding microRNAs (1–5), increasing evidence suggests that lncRNAs could play a critical role in regulation of diverse cellular processes such as stem cell pluripotency, development, cell growth and apoptosis and cancer metastasis (6–13). For example, miR-211 enhances the proliferation, migration and anchorage-independent colony formation of oral carcinoma cells (35). Alterations in the primary structure, secondary structure and expression levels of lncRNAs as well as their cognate RNA-binding proteins are often associated with human diseases, in particular cancer (36).",CitInt
 
 
 
 
examples/inaccurate/log.csv DELETED
@@ -1,2 +0,0 @@
1
- claim,evidence,label
2
- "In this way, loc285194 functions as a downstream p53 effector that exerts its anti-proliferative role by binding miR-211 in CRC and miR-23b in GC","We present evidence that loc285194 is a direct target for p53 and functions as a tumor suppressor in part through negative regulation of miR-211. Together, these results suggest that loc285194 is a p53-regulated tumor suppressor, which acts in part through repression of miR-211. Therefore, loc285194 suppresses tumor cell growth not only in vitro but also in vivo, further suggesting that loc285194 is a p53 downstream effector, functioning as a tumor suppressor. Finally, we demonstrate that loc285194 negatively regulates miR-211, which may in part account for loc285194-mediated cell growth inhibition. Together, these results suggest that both loc285194 and miR-211 are associated with the RISC complex through which loc285194 is able to reduce the miR-211 level and vice versa.","REFUTE (CitInt)"
 
 
 
examples/retrieval/CRISPR.pdf ADDED
Binary file (42.1 kB). View file
 
examples/retrieval/log.csv CHANGED
@@ -1,2 +1,5 @@
1
- pdf_file,claim,top_k,label
2
- https://journals.plos.org/plosmedicine/article/file?id=10.1371/journal.pmed.0030197&type=printable,"Falsified artemisinin family drugs with no active ingredient can be life-threatening.",5,SciFact
 
 
 
 
1
+ pdf_file,claim,label
2
+ https://journals.plos.org/plosmedicine/article/file?id=10.1371/journal.pmed.0030197&type=printable,"Falsified artemisinin family drugs with no active ingredient can be life-threatening.","SciFact (Support)"
3
+ CRISPR.pdf,"CRISPR is DNA and Cas is protein","CRISPR (Support)"
4
+ CRISPR.pdf,"CRISPR is RNA and Cas is protein","CRISPR (NEI)"
5
+ CRISPR.pdf,"CRISPR is protein and Cas is DNA","CRISPR (Refute)"