-
Notifications
You must be signed in to change notification settings - Fork 0
/
detect.py
59 lines (49 loc) · 16.1 KB
/
detect.py
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
from fake_lense import *
# Test Cases
test_cases = [
# Truth News
"In the wake of the recent election, residents of Amherst gathered at the local common for a peaceful vigil, expressing solidarity and resolve. The event, which took place at Edwards Church, drew a large crowd from across the community. Speakers addressed the need for unity and moving forward with strength. The atmosphere was one of reflection and hope, as people discussed the implications of the election results and what steps can be taken next.",
"The community was left in shock after the tragic death of FBI Special Agent David Raynor, who was found dead alongside his family in what authorities believe to be a murder-suicide. Raynor had been involved in several high-profile investigations, and his sudden death has raised many questions. Colleagues remember him as a dedicated officer who served with distinction. The investigation into the circumstances surrounding the incident continues.",
"The European Union has announced a new initiative to plant three billion trees across the continent by 2030 as part of its Green Deal. The initiative aims to combat climate change, restore biodiversity, and enhance rural and urban landscapes. Environmentalists have praised the project, which involves close collaboration with local communities, governments, and private landowners to ensure the trees are planted in the most effective areas.",
"A new public health campaign has been launched to encourage people to reduce their sugar intake. The campaign, led by the American Heart Association, highlights the link between high sugar consumption and chronic diseases such as diabetes and heart disease. The initiative includes guidelines for healthier eating habits and aims to raise awareness about the hidden sugars in processed foods.",
"The Pentagon has recently announced a series of reforms aimed at improving the acquisition process for military technology. These reforms are intended to streamline the development and deployment of critical defense systems, ensuring that the U.S. military remains at the forefront of technological advancements. Experts believe that these changes will help the Department of Defense save both time and resources in future projects.",
"The Kremlin has confirmed that Russian President Vladimir Putin and U.S. President Donald Trump will meet on the sidelines of an upcoming summit. The two leaders are expected to discuss a range of issues, including international security, trade, and the ongoing conflict in Syria. The meeting comes at a time of heightened tensions between the two countries, making it a crucial moment for diplomatic relations.",
"In a bid to enforce federal immigration laws, the Texas House of Representatives has approved a bill targeting sanctuary cities. The bill, which has sparked intense debate, would require local law enforcement to cooperate with federal immigration authorities. Supporters of the bill argue that it is necessary to maintain public safety, while opponents believe it could lead to racial profiling and other civil rights abuses.",
"The United Nations has launched a new initiative aimed at providing clean drinking water to remote areas in sub-Saharan Africa. The program, which is being implemented in partnership with local governments, will focus on building infrastructure and training communities to maintain water sources. This effort is expected to benefit millions of people who currently lack access to safe water.",
"NASA has announced a new mission to explore one of Jupiter's moons, Europa, which is believed to have a subsurface ocean beneath its icy crust. The mission, set to launch in the next few years, aims to investigate the potential for life on the moon and gather data that could provide insights into the origins of life in our solar system. Scientists are particularly excited about the possibility of discovering microbial life in Europa's ocean.",
"A recent report from the World Health Organization highlights the significant progress made in the fight against malaria. The report shows that malaria deaths have been reduced by half in the past two decades, thanks to increased access to bed nets, insecticides, and antimalarial drugs. While challenges remain, the WHO is optimistic that continued efforts could lead to the eventual eradication of the disease.",
"A new initiative in New York City is providing free mental health counseling to residents struggling with anxiety and depression. The program, funded by the city government, aims to address the growing mental health crisis exacerbated by the COVID-19 pandemic. Licensed therapists are available to provide counseling both in-person and online, making the service accessible to all residents.",
"The United Nations has declared the eradication of a deadly disease in Africa after decades of international efforts. The disease, which once claimed millions of lives annually, has been eliminated thanks to widespread vaccination campaigns and improved public health measures. This milestone is being celebrated as a major victory for global health and a testament to the power of international cooperation.",
"A new law passed in California aims to reduce plastic waste by banning single-use plastic bags statewide. The law, which goes into effect next year, requires retailers to offer reusable or paper bags instead. Environmental groups have praised the move as a critical step towards reducing ocean pollution and protecting marine life. Businesses are adapting to the change by promoting eco-friendly alternatives.",
"Researchers at MIT have developed a new type of battery that could revolutionize the renewable energy industry. The battery, which is made from abundant and inexpensive materials, has the potential to store large amounts of energy for long periods, making it ideal for use in solar and wind power systems. If commercialized, this technology could significantly reduce the cost of renewable energy and accelerate the transition to a sustainable energy future.",
"A team of archaeologists has uncovered a hidden chamber in the Great Pyramid of Giza, revealing new insights into ancient Egyptian engineering. The chamber, located deep within the pyramid, contains artifacts and inscriptions that have never been seen before. This discovery is shedding light on the construction methods used by the ancient Egyptians and is expected to lead to further research into the mysteries of the pyramids.",
# Fake News
"Contrary to initial reports, new evidence suggests that Michael Brown was not the innocent victim portrayed by the media. Witnesses now reveal that Brown had attempted to flee the scene after robbing a store and was shot while struggling with Officer Darren Wilson. Despite these revelations, mainstream media outlets continue to push a narrative that fuels public outrage and division, ignoring the complexities of the case.",
"In a shocking twist, FBI Special Agent David Raynor, who was reportedly investigating a connection between Hillary Clinton and a satanic pedophile ring, was found dead in his home. While official reports suggest a murder-suicide, conspiracy theorists claim that Raynor was silenced to protect powerful figures involved in the ring. The Clinton campaign has denied these allegations, dismissing them as baseless conspiracy theories.",
"A former government insider has come forward with explosive claims that a secret plan is in place to control the population through implanted microchips. According to the whistleblower, these microchips will be introduced under the guise of health and security measures, but their true purpose is to monitor and manipulate citizens. The source alleges that this plan has been in development for years and involves coordination between governments and tech companies.",
"A viral social media post claims that a new law requires all citizens to install government-approved cameras in their homes by the end of the year. The post alleges that these cameras will be used to monitor personal activities and report any suspicious behavior to authorities. Government officials have debunked this claim, confirming that no such law exists and urging the public to verify information before sharing it online.",
"A widely shared online article claims that scientists have discovered a hidden continent beneath Antarctica, filled with ancient civilizations and advanced technologies. The article suggests that world governments are keeping this discovery a secret to prevent panic and to control access to the powerful technologies found there. Experts have dismissed these claims as pure fiction, with no scientific evidence to support such a discovery.",
"Donald Trump just promised that under his administration, torture methods would be worse than ever before. In a recent interview, he suggested that waterboarding is just the beginning and that he plans to implement even more extreme measures to extract information from suspected terrorists. This statement has caused outrage among human rights organizations, who argue that such actions would violate international law.",
"New research claims that MMR vaccines are linked to an increased risk of autism in children. The study, which has been widely criticized by the medical community, suggests that the combination of the measles, mumps, and rubella vaccines can trigger developmental disorders in a small percentage of children. Despite the lack of credible evidence, this claim has reignited the debate over vaccine safety.",
"Conspiracy theorists are once again in the spotlight after a new claim that a group of elites is planning to use 5G technology to control the population. According to these theories, the widespread implementation of 5G networks will allow governments to monitor and manipulate citizens' behavior. Scientists and technology experts have repeatedly debunked these claims, stating that 5G poses no such risks.",
"A viral social media post alleges that the United Nations is secretly planning to take over the world by enforcing a global government. The post claims that the UN's Sustainable Development Goals are a cover for a plot to strip nations of their sovereignty and impose a one-world government. Experts have dismissed these allegations as baseless and have reiterated that the UN's goals are aimed at promoting peace and development worldwide.",
"A viral video has surfaced claiming that the COVID-19 vaccines contain microchips that are used to track and control people. The video, which has been widely shared on social media, alleges that the microchips are part of a global conspiracy to monitor individuals' movements. Health experts have repeatedly debunked these claims, emphasizing that the vaccines are safe and do not contain any such devices.",
"In an unexpected turn of events, a whistleblower has come forward with documents alleging that the U.S. government has been secretly communicating with extraterrestrial beings for decades. The whistleblower claims that these interactions have been kept hidden from the public, and that the government has been working with the aliens on advanced technologies. The government has denied these allegations, calling them a hoax.",
"A new conspiracy theory has emerged, suggesting that the wildfires in California were deliberately started by powerful elites as part of a land grab scheme. According to this theory, the fires were set to clear out land for new developments, with the goal of profiting from the destruction. Authorities have dismissed these claims, attributing the fires to a combination of extreme weather conditions and human error.",
"Reports are circulating that a secret society is controlling world events from behind the scenes, manipulating governments, economies, and even natural disasters to achieve their goals. The society, allegedly composed of the world's richest and most powerful individuals, is said to be orchestrating a new world order. Experts have debunked these claims as baseless conspiracy theories with no factual evidence.",
"A viral post claims that drinking a special herbal tea can cure cancer, but medical professionals warn that there is no scientific evidence to support this claim. The post suggests that the tea, made from a blend of rare herbs, can eliminate cancer cells without the need for chemotherapy or radiation. Oncologists stress that patients should follow proven treatments and consult their doctors before trying alternative remedies.",
"A viral conspiracy theory claims that the recent power outage in Texas was deliberately engineered by the federal government to punish the state for its political leanings. According to the theory, the government used secret technology to cause the outage, which left millions without electricity during a winter storm. Officials have repeatedly denied these allegations, stating that the outage was caused by a combination of extreme weather and infrastructure failures.",
"In a bizarre claim, a self-proclaimed psychic has predicted that a massive asteroid will strike Earth next year, causing widespread destruction. The psychic, who has gained a large following on social media, claims to have seen visions of the impact and warns that world governments are hiding the truth. Scientists have debunked the prediction, confirming that there are no known asteroids on a collision course with Earth.",
"A fringe group has spread rumors that the moon landing was faked by NASA as part of a Cold War propaganda effort. The group claims that the entire event was staged in a Hollywood studio, and that the astronauts never actually set foot on the moon. Despite overwhelming evidence to the contrary, the theory continues to attract attention online, fueling doubts about one of humanity's greatest achievements.",
"A social media post has gone viral claiming that a new wonder drug can cure all forms of cancer within days. The post alleges that the drug, which is being suppressed by pharmaceutical companies, is a natural remedy with no side effects. Medical experts have condemned the post as dangerous misinformation, urging people to rely on proven medical treatments rather than unverified miracle cures.",
"A fabricated news report has claimed that the government is planning to enforce mandatory vaccinations for all citizens, regardless of medical conditions or religious beliefs. The report, which has been widely shared, suggests that those who refuse will be imprisoned. Public health officials have strongly refuted these claims, emphasizing that vaccination policies prioritize personal choice and public health safety.",
"A new conspiracy theory claims that the recent surge in wildfires across the globe is actually part of a coordinated effort by governments to depopulate rural areas. According to this theory, the fires are being intentionally set to force people to move to urban centers where they can be more easily controlled. Authorities have dismissed these claims as baseless and emphasized that the fires are the result of climate change and human negligence.",
"A viral hoax has emerged online, claiming that the COVID-19 vaccines are part of a plot to alter human DNA and create a new hybrid species. The hoax, which has been widely debunked by scientists, alleges that the vaccines contain genetic material that will permanently change the human genome. Experts have reiterated that the vaccines are safe and do not have any such effects on human DNA.",
"A fabricated news story has spread on social media, alleging that a popular fast-food chain has been using lab-grown meat that is actually derived from human cells. The story claims that the company has been secretly growing human tissue in labs to produce its burgers, leading to widespread outrage. Health inspectors and company representatives have categorically denied these allegations, calling them completely unfounded and sensationalized.",
]
# Detection Phase
bert_lense, bert_tokenizer = load_model_and_tokenizer('./model/bert_lense', AutoModelForSequenceClassification)
gpt_lense, gpt_tokenizer = load_model_and_tokenizer('./model/gpt_lense', AutoModelForCausalLM)
for i, text in enumerate(test_cases):
result = FakeLense(text, bert_lense, bert_tokenizer, gpt_lense, gpt_tokenizer)
print(f"News {i+1} : {result}\n")