longformer-base-health-fact2

This model is a fine-tuned version of allenai/longformer-base-4096 on the health_fact dataset. It achieves the following results on the VALIDATION set:

  • Loss: 0.5858
  • Micro F1: 0.8122
  • Macro F1: 0.6830
  • False F1: 0.7941
  • Mixture F1: 0.5015
  • True F1: 0.9234
  • Unproven F1: 0.5128

The following are the results on the TEST set:

  • Macro F1: 0.6732897445517078
  • Accuracy: 0.797242497972425
  • False Accuracy: 0.8092783505154639
  • Mixture Accuracy: 0.5323383084577115
  • True Accuracy: 0.9081803005008348
  • Unproven Accuracy: 0.4

Model description

The health fact dataset is for building fact-checking models related to health. Here is how you can use this model:

import torch
from transformers import pipeline

claim = "A mother revealed to her child in a letter after her death that she had just one eye because she had donated the other to him."
text = "In April 2005, we spotted a tearjerker on the Internet about a mother who gave up one of her eyes to a son who had lost one of his at an early age. By February 2007 the item was circulating in e-mail in the following shortened version: My mom only had one eye. I hated herโ€ฆ She was such an embarrassment. She cooked for students and teachers to support the family. There was this one day during elementary school where my mom came to say hello to me. I was so embarrassed. How could she do this to me? I ignored her, threw her a hateful look and ran out. The next day at school one of my classmates said, โ€œEEEE, your mom only has one eye!โ€ I wanted to bury myself. I also wanted my mom to just disappear. I confronted her that day and said, โ€œIf youโ€™re only gonna make me a laughing stock, why donโ€™t you just die?โ€ My mom did not respondโ€ฆ I didnโ€™t even stop to think for a second about what I had said, because I was full of anger. I was oblivious to her feelings. I wanted out of that house, and have nothing to do with her. So I studied real hard, got a chance to go abroad to study. Then, I got married. I bought a house of my own. I had kids of my own. I was happy with my life, my kids and the comforts. Then one day, my Mother came to visit me. She hadnโ€™t seen me in years and she didnโ€™t even meet her grandchildren. When she stood by the door, my children laughed at her, and I yelled at her for coming over uninvited. I screamed at her, โ€œHow dare you come to my house and scare my children! GET OUT OF HERE! NOW!! !โ€ And to this, my mother quietly answered, โ€œOh, Iโ€™m so sorry. I may have gotten the wrong address,โ€ and she disappeared out of sight. One day, a letter regarding a school reunion came to my house. So I lied to my wife that I was going on a business trip. After the reunion, I went to the old shack just out of curiosity. My neighbors said that she died. I did not shed a single tear. They handed me a letter that she had wanted me to have. My dearest son, I think of you all the time. Iโ€™m sorry that I came to your house and scared your children. I was so glad when I heard you were coming for the reunion. But I may not be able to even get out of bed to see you. Iโ€™m sorry that I was a constant embarrassment to you when you were growing up. You seeโ€ฆโ€ฆ..when you were very little, you got into an accident, and lost your eye. As a mother, I couldnโ€™t stand watching you having to grow up with one eye. So I gave you mine. I was so proud of my son who was seeing a whole new world for me, in my place, with that eye. With all my love to you, Your mother. In its earlier incarnation, the story identified by implication its location as Korea through statements made by both the mother and the son (the sonโ€™s โ€œI left my mother and came to Seoulโ€ and the motherโ€™s โ€œI wonโ€™t visit Seoul anymoreโ€). It also supplied a reason for the sonโ€™s behavior when his mother arrived unexpectedly to visit him (โ€œMy little girl ran away, scared of my momโ€™s eyeโ€ and โ€œI screamed at her, โ€˜How dare you come to my house and scare my daughter!'โ€). A further twist was provided in the original: rather than gaining the news of his motherโ€™s death from neighbors (who hand him her letter), the son instead discovered the woman who bore him lying dead on the floor of what used to be his childhood home, her missive to him clutched in her lifeless hand: Give your parents roses while they are alive, not deadMY mom only had one eye. I hated her โ€ฆ she was such an embarrassment. My mom ran a small shop at a flea market. She collected little weeds and such to sell โ€ฆ anything for the money we needed she was such an embarrassment. There was this one day during elementary school โ€ฆ It was field day, and my mom came. I was so embarrassed. How could she do this to me? I threw her a hateful look and ran out. The next day at school โ€ฆ โ€œyour mom only has one eye?!? !โ€ โ€ฆ And they taunted me. I wished that my mom would just disappear from this world so I said to my mom, โ€œmom โ€ฆ Why donโ€™t you have the other eye?! If youโ€™re only going to make me a laughingstock, why donโ€™t you just die?!! !โ€ my mom did not respond โ€ฆ I guess I felt a little bad, but at the same time, it felt good to think that I had said what Iโ€™d wanted to say all this timeโ€ฆ maybe it was because my mom hadnโ€™t punished me, but I didnโ€™t think that I had hurt her feelings very badly. That nightโ€ฆ I woke up, and went to the kitchen to get a glass of water. My mom was crying there, so quietly, as if she was afraid that she might wake me. I took a look at her, and then turned away. Because of the thing I had said to her earlier, there was something pinching at me in the corner of my heart. Even so, I hated my mother who was crying out of her one eye. So I told myself that I would grow up and become successful. Because I hated my one-eyed mom and our desperate povertyโ€ฆ then I studied real hard. I left my mother and came to Seoul and studied, and got accepted in the Seoul University with all the confidence I had. Then, I got married. I bought a house of my own. Then I had kids, tooโ€ฆ now Iโ€™m living happily as a successful man. I like it here because itโ€™s a place that doesnโ€™t remind me of my mom. This happiness was getting bigger and bigger, whenโ€ฆ what?! Whoโ€™s thisโ€ฆit was my motherโ€ฆ still with her one eye. It felt as if the whole sky was falling apart on me. My little girl ran away, scared of my momโ€™s eye. And I asked her, โ€œwho are you? !โ€ โ€œI donโ€™t know you!! !โ€ as if trying to make that real. I screamed at her, โ€œHow dare you come to my house and scare my daughter!โ€ โ€œGET OUT OF HERE! NOW!! !โ€ and to this, my mother quietly answered, โ€œoh, Iโ€™m so sorry. I may have gotten the wrong address,โ€ and she disappeared out of sight. Thank goodnessโ€ฆ she doesnโ€™t recognize meโ€ฆ I was quite relieved. I told myself that I wasnโ€™t going to care, or think about this for the rest of my life. Then a wave of relief came upon meโ€ฆ One day, a letter regarding a school reunion came to my house. So, lying to my wife that I was going on a business trip, I went. After the reunion, I went down to the old shack, that I used to call a houseโ€ฆ just out of curiosity there, I found my mother fallen on the cold ground. But I did not shed a single tear. She had a piece of paper in her handโ€ฆ. it was a letter to me. My sonโ€ฆ I think my life has been long enough nowโ€ฆ Andโ€ฆ I wonโ€™t visit Seoul anymoreโ€ฆ but would it be too much to ask if I wanted you to come visit me once in a while? I miss you so muchโ€ฆ and I was so glad when I heard you were coming for the reunion. But I decided not to go to the school. โ€ฆfor youโ€ฆ and Iโ€™m sorry that I only have one eye, and I was an embarrassment for you. You see, when you were very little, you got into an accident, and lost your eye. as a mom, I couldnโ€™t stand watching you having to grow up with only one eyeโ€ฆ so I gave you mineโ€ฆ I was so proud of my son that was seeing a whole new world for me, in my place, with that eye. I was never upset at you for anything you didโ€ฆ the couple times that you were angry with me, I thought to myself, โ€˜itโ€™s because he loves meโ€ฆโ€™ my son. Oh, my sonโ€ฆ I donโ€™t want you to cry for me, because of my death. My son, I love you my son, I love you so much. With all modern medical technology, transplantation of the eyeball is still impossible. The optic nerve isnโ€™t an ordinary nerve, but instead an inset running from the brain. Modern medicine isnโ€™t able to โ€œconnectโ€ an eyeball back to brain after an optic nerve has been severed, let alone transplant the eye from a different person. (The only exception is the cornea, the transparent part in front of the eye: corneas are transplanted to replace injured and opaque ones.) We wonโ€™t try to comment on whether any surgeon would accept an eye from a living donor for transplant into another โ€” weโ€™ll leave that to others who are far more knowledgeable about medical ethics and transplant procedures. But we will note that the plot device of a motherโ€™s dramatic sacrifice for the sake of her childโ€™s being revealed in a written communication delivered after her demise appears in another legend about maternal love: the 2008 tale about a woman who left a touching message on her cell phone even as life ebbed from her as she used her body to shield the tot during an earthquake. Giving up oneโ€™s own life for a loved one is central to a 2005 urban legend about a boy on a motorcycle who has his girlfriend hug him one last time and put on his helmet just before the crash that kills him and spares her. Returning to the โ€œnotes from the deadโ€ theme is the 1995 story about a son who discovers only through a posthumous letter from his mother what their occasional dinner โ€œdatesโ€ had meant to her. Another legend weโ€™re familiar with features a meme used in the one-eyed mother story (the coming to light of the enduring love of the person who died for the completely unworthy person sheโ€™d lavished it on), but that one involves a terminally ill woman and her cheating husband. In it, an about-to-be-spurned wife begs the adulterous hoon sheโ€™d married to stick around for another 30 days and to carry her over the threshold of their home once every day of that month as her way of keeping him around long enough for her to kick the bucket and thus spare their son the knowledge that his parents were on the verge of divorce."

label = "false"

device = 0 if torch.cuda.is_available() else -1
pl = pipeline("text-classification", model="nbroad/longformer-base-health-fact", device=device)

input_text = claim+pl.tokenizer.sep_token+text
print(len(pl.tokenizer(input_text).input_ids))
# 2361 (which is why longformer is useful)
pl(input_text)
# [{'label': 'false', 'score': 0.8015491962432861}]

Intended uses & limitations

More information needed

Training and evaluation data

More information needed

Training procedure

Training hyperparameters

The following hyperparameters were used during training:

  • learning_rate: 3e-05
  • train_batch_size: 16
  • eval_batch_size: 32
  • seed: 18
  • optimizer: Adam with betas=(0.9,0.999) and epsilon=1e-06
  • lr_scheduler_type: linear
  • lr_scheduler_warmup_ratio: 0.1
  • num_epochs: 3
  • mixed_precision_training: Native AMP

Training results

Training Loss Epoch Step Validation Loss Micro F1 Macro F1 False F1 Mixture F1 True F1 Unproven F1
0.555 1.0 613 0.5243 0.7842 0.5535 0.7698 0.4170 0.8938 0.1333
0.4282 2.0 1226 0.5008 0.8031 0.6393 0.7829 0.4605 0.9199 0.3939
0.2897 3.0 1839 0.5858 0.8122 0.6830 0.7941 0.5015 0.9234 0.5128

Framework versions

  • Transformers 4.19.0.dev0
  • Pytorch 1.11.0a0+17540c5
  • Datasets 2.1.1.dev0
  • Tokenizers 0.12.1
Downloads last month
32
Safetensors
Model size
0.1B params
Tensor type
I64
ยท
F32
ยท
Inference Providers NEW
This model isn't deployed by any Inference Provider. ๐Ÿ™‹ Ask for provider support

Model tree for nbroad/longformer-base-health-fact

Finetuned
(125)
this model

Dataset used to train nbroad/longformer-base-health-fact

Space using nbroad/longformer-base-health-fact 1

Evaluation results