Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Oisn huggingface baseline #8

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Binary file added __pycache__/baseline.cpython-36.pyc
Binary file not shown.
Binary file added __pycache__/baseline.cpython-37.pyc
Binary file not shown.
Binary file added __pycache__/dataset.cpython-36.pyc
Binary file not shown.
Binary file added __pycache__/dataset.cpython-37.pyc
Binary file not shown.
Binary file added __pycache__/util.cpython-36.pyc
Binary file not shown.
Binary file added __pycache__/util.cpython-37.pyc
Binary file not shown.
File renamed without changes.
25,413 changes: 25,413 additions & 0 deletions data/test_stances.csv

Large diffs are not rendered by default.

File renamed without changes.
File renamed without changes.
File renamed without changes.
52 changes: 52 additions & 0 deletions exploration/disagree_examples.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,52 @@
HEAD: Spider burrowed through tourist's stomach and up into his chest
BODY: "Fear not arachnophobes, the story of Bunbury's ""spiderman"" might not be all it seemed.
Perth scientists have cast doubt over claims that a spider burrowed into a man's body during his first trip to Bali. The story went global on Thursday, generating hundreds of stories online.
Earlier this month, Dylan Thomas headed to the holiday island and sought medical help after experiencing ""a really burning sensation like a searing feeling"" in his abdomen.
Dylan Thomas says he had a spider crawl underneath his skin.
Thomas said a specialist dermatologist was called in and later used tweezers to remove what was believed to be a ""tropical spider"".
But it seems we may have all been caught in a web... of misinformation.
Arachnologist Dr Volker Framenau said whatever the creature was, it was ""almost impossible"" for the culprit to have been a spider.
""If you look at a spider, the fangs, the mouth parts they have, they are not able to burrow. They can't get through skin,"" he said.
""We thought it may have been something like a mite, there are a few different parasitic mites out there, which can sometimes look a bit like a spider. I can't think of any spider which could do this to a person.""
Dr Mark Harvey from the Western Australian Museum agreed and said he found the case ""bizarre"".
""I must confess I was amazed because I've never heard of a spider being able to survive under the skin of a human, or indeed any mammal,"" he said.
""Spiders need air to breathe, they have spiracles on the sides of their bodies where air comes into their system through a series of what we call book lungs. Being under the skin of somebody, I would have thought they wouldn't have enough air to survive.
""Even if it was a mite, I've never seen anything like this. Even if it was an insect, I've never heard of an insect crawling under the skin like this, so it really is a remarkable case.""
Dr Harvey said spiders were widely feared in the community and often were the subject of urban legends.
""We hear about people going on holidays and having spiders lay eggs under the skin. Then [the baby spiders] burst out when they return from their holiday in the tropics,"" he said.
""None of those are true, they're just made up stories.
""They're not actually able to dig through the skin, that's why this case is so unusual. Some can burrow into soil, but they have to remove soil particles one at a time if they want to do that.""
Something which is true, according to Dr Harvey, is that certain arachnids do ""live on humans"".
""We all have mites living on our faces. They're follicle mites, but they're absolutely miniscule and you can't see them. We transmit them to our children when we have kids,"" he said.
""They live in the bases of hair follicles on our faces and in some of the pores in our skin. Those mites are so small, you can't see them, and they're not going to cause a blemish on the skin like this lad has on his stomach.""
Dr Framenau said that much of the confusion could be eliminated by keeping or catching the creepy crawly offender, dead or alive, and enlisting the help of experts.
""It would be great if they collected it or took a photo of it,"" he said.
""If you have been bitten by something, the best thing you can do is collect it and submit it to a museum for identification before these things go viral.""
Dylan Thomas has been contacted for comment.




HEAD: Pope Francis turns out not to have made pets in heaven comment
BODY: "NEW YORK — Pope Francis has given hope to gays, unmarried couples and advocates of the Big Bang theory. Now, he has endeared himself to dog lovers, animal-rights activists and vegans.
Trying to console a little boy whose dog had died, Pope Francis told him in a recent public appearance on St Peter’s Square that “paradise is open to all of God’s creatures”. While it is unclear whether the Pope’s remarks helped soothe the child, they were welcomed by groups such as the Humane Society and People for the Ethical Treatment of Animals (PETA).
In his relatively short tenure as leader of the world’s one billion Roman Catholics since taking over from Benedict XVI, Pope Francis, 77, has repeatedly caused a stir among conservatives in the church.
He has suggested more lenient positions than his predecessor on issues such as homosexuality, single motherhood and unwed couples.
Theologians cautioned that Pope Francis had spoken casually, not made a doctrinal statement.
Reverend James Martin, a Jesuit priest and editor-at-large of America, a Catholic magazine, said he believed that Pope Francis was at least asserting that “God loves and Christ redeems all of creation”, even though conservative theologians have said paradise is not for animals. “He said paradise is open to all creatures,” Rev Martin said.
The question of whether animals go to heaven has been debated for much of the church’s history. Pope Benedict said during a 2008 sermon that when an animal dies, it “just means the end of existence on earth”.
Ms Christine Gutleben, senior director of the Humane Society, said Pope Francis’ apparent reversal of his predecessor’s view could be enormous. “If the Pope did mean that all animals go to heaven, then the implication is that animals have a soul. And if that is true, then we ought to seriously consider how we treat them because they mean something to God,” she said.
Ms Sarah Withrow King, director of Christian outreach and engagement at PETA, one of the most activist anti-slaughterhouse groups, said the Pope’s remarks could move Catholics away from consuming meat. But there are differing views.
Mr Dave Warner, a spokesman for the National Pork Producers Council, said in an email that it “certainly does not mean that slaughtering and eating animals is a sin”. THE NEW YORK TIMES"







"No, it's not Tiger Woods selling an island in Lake Mälaren",965,disagree

ADVISORY-Islamist rebel leader killed in U.S. strike - Somali government,313,disagree

Weather Reporter Caught Writing His Name In The Snow Was NOT Ready To Go On Camera (UPDATED),975,disagree
24 changes: 24 additions & 0 deletions huggingface/example.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
from sentence_transformers import SentenceTransformer, util

query = "Lots of people live in london"
docs = ["Few people live in london", "London is known for its financial district"]

#Load the model
model = SentenceTransformer('sentence-transformers/multi-qa-MiniLM-L6-cos-v1')

#Encode query and documents
query_emb = model.encode(query)
doc_emb = model.encode(docs)

#Compute dot score between query and all document embeddings
scores = util.dot_score(query_emb, doc_emb)[0].cpu().tolist()

#Combine docs & scores
doc_score_pairs = list(zip(docs, scores))

#Sort by decreasing score
doc_score_pairs = sorted(doc_score_pairs, key=lambda x: x[1], reverse=True)

#Output passages & scores
for doc, score in doc_score_pairs:
print(score, doc)
8 changes: 8 additions & 0 deletions huggingface/nli.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,8 @@
from sentence_transformers import CrossEncoder
model = CrossEncoder('cross-encoder/nli-distilroberta-base')
scores = model.predict([('A man is eating pizza', 'A man eats something'), ('A black race car starts up in front of a crowd of people.', 'A man is driving down a lonely road.')])

#Convert scores to labels
label_mapping = ['contradiction', 'entailment', 'neutral']
labels = [label_mapping[score_max] for score_max in scores.argmax(axis=1)]
print(labels)
Loading