misinfo_detection_app / scripts /single_climate_example.jl
stefanjwojcik's picture
add scripts
143b0d4 verified
include("src/narrative_construction.jl")
# Create a new claim
claim1 = createClaim("Antarctica is gaining ice and is not actually warming",
"Antarctical is losing ice year by year due to the effects of climate change",
"Facebook post",
["antarctica", "global warming", "climate change"])
claim2 = createClaim("It's natural cycles/variation in weather, not global warming",
"There is substantial evidence that the current warming is not due to natural cycles",
"Facebook post",
["natural cycles", "global warming", "climate change"])
climate_narrative = Narrative(
randid(),
"Climate Change Denial",
"Climate Change",
"Scientists, Elites",
"The science behind climate change inconclusive or flawed",
Claim[])
# Add the claims to the narrative
add_claim!(climate_narrative, claim1)
add_claim!(climate_narrative, claim2)
## show the narrative
climate_narrative
## Now, let's deploy the narrative to the database
candidate_data = DataFrame()
"""
## Deploy narrative does the following:
1. Retrieves the data from the database
2. Filters the data based on the keywords in the claims
3. Generates embeddings for the claims and the data
4. Computes the similarity between the claims and the data
5. Returns the top 10 most similar data points
"""
deploy_narrative_model!(climate_narrative, threshold=.2)