Spaces:
Runtime error
Runtime error
File size: 6,471 Bytes
0f14448 1707180 0f14448 b4895cc dd4ffe9 b4895cc 1707180 fedacac 1707180 02675ac 6ee5293 1707180 2ecadd9 b77a858 098e077 1707180 098e077 6ee5293 93f7dbe 57b24ef 098e077 02675ac 1707180 57b24ef 098e077 5f194a6 fedacac 1707180 098e077 57b24ef 9832163 fedacac 9832163 1707180 fedacac dd4ffe9 fedacac dd4ffe9 5f194a6 dd4ffe9 fedacac 1707180 b77a858 dd4ffe9 |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 |
from transformers import pipeline
import streamlit as st
import pandas as pd
from PIL import Image
import os
# title
st.title('Combatting Climate Change Misinformation with Transformers')
st.markdown("## The Gist")
st.markdown("**The Problem**: Climate change misinformation spreads quickly and is difficult to combat. However, its important to do so, because climate change misinformation has direct impacts on public opinion and public policy surrounding climate change.")
st.markdown("**The 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.")
st.markdown("**The Approach**")
st.markdown("* There are many steps to this pipeline. Here, I focus on fine-tuning a transformer model, ClimateBERT, using the textual entailment task.")
st.markdown("* Given a {claim, evidence} pair, determine whether the climate claim is supported or refuted (or neither) by the evidence")
# section 1: the context, problem; how to address
st.markdown("### The Problem 🤔")
st.markdown("Misinformation about climate change spreads quickly and has direct impacts on public opinion and public policy surrounding the climate. Further, misinformation is difficult to combat, and people are able to \"verify\" false climate claims on biased sites. Ideally, people would be able to easily verify climate claims. This is where transformers come in.")
# section 2: what is misinformation? how is it combatted now? how successful is this?
st.markdown("### More about Misinformation")
st.markdown("What is misinformation? How does it spread?")
st.markdown("* **Misinformation** can be defined as “false or inaccurate information, especially that which is deliberately intended to deceive.”")
st.markdown("* It can exist in different domains, and each domain has different creators and distributors of misinformation.")
st.markdown("* Misinformation regarding climate change is often funded by conservative foundations or large energy industries such as gas, coal, and oil. (1)")
misinfo_flowchart = Image.open('images/misinfo_chart.jpeg')
st.image(misinfo_flowchart, caption='The misinformation flowchart. (1)')
st.markdown("**Why does this matter?** Through echo chambers, polarization, and feedback loops, misinformation can spread from these large organizes to the public, thus arming the public with pursausive information designed to create scepticism around and/or denial of climate change, its urgency, and climate change scientists. This is especially problematic in democratic societies, where the public, to some extent, influences governmental policy decisions (brookings). Existing research suggests that misinformation directly contributes to public support of political inaction and active stalling or rejection of pro- climate change policies (1).")
st.markdown("How is climate change misinformation combatted now? Below are a few of the ways according to the Brookings Institute:")
st.markdown("1. Asking news sources to call out misinformation")
st.markdown("2. Teaching and encouraging media literacy among the public (how to detect fake news, critical evaluation of information provided, etc.")
st.markdown("3. Governments should encourage independent journalism but avoid censoring news")
st.markdown("4. Social media platform investment in algorithmic detection of fake news")
st.markdown("However, many of the proposed solutions above require adoption of behaviors. This is difficult to acheive, particularly among news organizations and social media platforms which receive monetary benefits from misinformation in the form of ad revenue from cite usage and viewership.")
# section 3: how can transformers help?
st.markdown("### How can Transformers Help?")
# fever dataset
# natural language inference (nli) entailment/contradiction/neutral adoption to support/refute/n.e.i.
# extention to climate -climatefever
# section 4: The process
# this is the pipeline in my notes (u are here highlight)
st.markdown("### The Process")
st.markdown("Imagine: A person is curious about whether a claim they heard about climate change is true. How can transformers help validate or refute the claim?")
st.markdown("1. User inputs a climate claim")
#input_gif = Image.open('images/input_box.gif')
#st.image(input_gif, width=100)
st.markdown("2. Retrieve evidence related to input claim \
- For each claim, collect N related documents. These documents are selected by finding the N documents with the highest similarity scores to the claim.")
st.markdown("- Current area of research: How do we keep the set of curated documents up-to-date? Validate their contents?")
st.markdown("3. Send (claim, evidence) pairs to a transformer model. Have the model predict whether each evidence supports, refutes, or is not relevant to the claim. (📍 YOU ARE HERE!)")
st.markdown("4. Report back to the user: The supporting evidence for the claim (if any), the refuting evidence for the claim (if any). If no relevant evidence is found, report that the claim cannot be supported or refuted by current evidence.")
# section 5: my work
st.markdown("### Climate Claim Fact-Checking with Transformers")
st.markdown("My work focuses on step 3 of the process: Training a transformer model to accurately categorize (claim, evidence) as:")
st.markdown("* evidence *supports* (entails) claim")
st.markdown("* evidence *refutes* (contradicts) claim")
st.markdown("* evidence *does not provide enough info to support or refute* (neutral) claim")
st.markdown("For this project, I fine-tuned 3 different models on the text entailment task.")
st.markdown("**Model 1**: [DistilRoBERTa](https://huggingface.co/distilroberta-base)")
st.markdown("**Model 2**: [ClimateBERT](https://huggingface.co/climatebert/distilroberta-base-climate-f)")
st.markdown("**Model 3**: [RoBERTa Fine-tuned on NLI Task](https://huggingface.co/ynie/roberta-large-snli_mnli_fever_anli_R1_R2_R3-nli)")
# section 6: analysis
# section 7: conclusion
# References + Resource Links
st.markdown("### Resource Links")
# climatefever paper
# feverpaper
# fact checking covid paper
# models
# nli fine-tuning notebook
st.markdown("### References")
st.markdown("1. https://www.carbonbrief.org/guest-post-how-climate-change-misinformation-spreads-online")
st.markdown("2. https://www.brookings.edu/research/how-to-combat-fake-news-and-disinformation/") |