amandakonet commited on
Commit
f61c39a
β€’
1 Parent(s): db98af3
Files changed (1) hide show
  1. app.py +8 -5
app.py CHANGED
@@ -13,7 +13,7 @@ st.markdown("**Problem**πŸ€”: Climate change misinformation spreads quickly and
13
  st.markdown("**Solution**πŸ’‘: Develop a pipeline in which users can input climate change claims... and the pipeline returns whether the claim is refuted or supported by current climate science, along with the corresponding evidence.")
14
  st.markdown("**Approach**πŸ”‘:")
15
  st.markdown("* There are many steps to this pipeline. Here, I focus on fine-tuning a transformer model, ClimateBERT, using the textual entailment task.")
16
- st.markdown("* The dataset used is Climate FEVER, a natural language inference dataset with 1,579 {claim, [evidence], [label]} tuples")
17
  st.markdown("* Given a {claim, evidence} pair, determine whether the climate claim is supported or refuted (or neither) by the evidence")
18
 
19
  st.markdown("---")
@@ -85,12 +85,14 @@ st.markdown("* evidence *refutes* (contradicts) claim")
85
  st.markdown("* evidence *does not provide enough info to support or refute* (neutral) claim")
86
  st.markdown("For this project, I fine-tune ClimateBERT (4) on the text entailment task")
87
 
88
- st.markdown("### Try it out!")
 
 
89
 
90
 
91
 
92
  # section 6: analysis
93
- st.markdown("### Critical Analysis")
94
  st.markdown("What else could we do?")
95
  st.markdown("* Given more data, the performance of the model can be greatly improved. This is just a proof of concept")
96
  st.markdown("* This is only one small part of the puzzle!")
@@ -98,7 +100,7 @@ st.markdown("In the complete pipeline (from user input to final output), we coul
98
 
99
 
100
  # References + Resource Links
101
- st.markdown("### Resource Links")
102
  # climatefever paper
103
  # feverpaper
104
  # fact checking covid paper
@@ -106,7 +108,8 @@ st.markdown("### Resource Links")
106
  # nli fine-tuning notebook
107
 
108
  st.markdown("### References")
 
109
  st.markdown("1. https://www.carbonbrief.org/guest-post-how-climate-change-misinformation-spreads-online")
110
  st.markdown("2. https://www.brookings.edu/research/how-to-combat-fake-news-and-disinformation/")
111
  st.markdown("3. Climate FEVER [paper](https://arxiv.org/abs/2012.00614), [huggingface repo](https://huggingface.co/datasets/climate_fever), and [github](https://github.com/huggingface/datasets/tree/master/datasets/climate_fever)")
112
- st.markdown("4. [ClimateBERT](https://climatebert.ai/), [paper](https://arxiv.org/abs/2110.12010)")
 
13
  st.markdown("**Solution**πŸ’‘: Develop a pipeline in which users can input climate change claims... and the pipeline returns whether the claim is refuted or supported by current climate science, along with the corresponding evidence.")
14
  st.markdown("**Approach**πŸ”‘:")
15
  st.markdown("* There are many steps to this pipeline. Here, I focus on fine-tuning a transformer model, ClimateBERT, using the textual entailment task.")
16
+ st.markdown("* The dataset used is Climate FEVER, a natural language inference dataset with 1,535 {claim, [evidence], [label]} tuples")
17
  st.markdown("* Given a {claim, evidence} pair, determine whether the climate claim is supported or refuted (or neither) by the evidence")
18
 
19
  st.markdown("---")
 
85
  st.markdown("* evidence *does not provide enough info to support or refute* (neutral) claim")
86
  st.markdown("For this project, I fine-tune ClimateBERT (4) on the text entailment task")
87
 
88
+ st.markdown("## Try it out!")
89
+ txt_class = pipeline('text-classification', model='amandakonet/climatebert-fact-checking', use_auth_token = os.environ["hf_token"])
90
+ user_text = st.text_input('Add the text for users to upload!')
91
 
92
 
93
 
94
  # section 6: analysis
95
+ st.markdown("## Critical Analysis")
96
  st.markdown("What else could we do?")
97
  st.markdown("* Given more data, the performance of the model can be greatly improved. This is just a proof of concept")
98
  st.markdown("* This is only one small part of the puzzle!")
 
100
 
101
 
102
  # References + Resource Links
103
+ st.markdown("## Resource Links")
104
  # climatefever paper
105
  # feverpaper
106
  # fact checking covid paper
 
108
  # nli fine-tuning notebook
109
 
110
  st.markdown("### References")
111
+ st.markdonw("My [huggingface model card](https://huggingface.co/amandakonet/climatebert-fact-checking), [adopted Climate FEVER dataset card](https://huggingface.co/datasets/amandakonet/climate_fever_adopted), and [project code on github](https://github.com/amandakonet/climate-change-misinformation)")
112
  st.markdown("1. https://www.carbonbrief.org/guest-post-how-climate-change-misinformation-spreads-online")
113
  st.markdown("2. https://www.brookings.edu/research/how-to-combat-fake-news-and-disinformation/")
114
  st.markdown("3. Climate FEVER [paper](https://arxiv.org/abs/2012.00614), [huggingface repo](https://huggingface.co/datasets/climate_fever), and [github](https://github.com/huggingface/datasets/tree/master/datasets/climate_fever)")
115
+ st.markdown("4. [ClimateBERT](https://climatebert.ai/), [paper](https://arxiv.org/abs/2110.12010)")