abhik1505040 commited on
Commit
361416d
1 Parent(s): 057ee77

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +4 -1
README.md CHANGED
@@ -64,8 +64,11 @@ see the [paper](https://aclanthology.org/2021.findings-acl.413/) and the [offici
64
  ## Using this model in `transformers` (tested on 4.11.0.dev0)
65
 
66
  ```python
 
67
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
68
 
 
 
69
  article_text = """Videos that say approved vaccines are dangerous and cause autism, cancer or infertility are among those that will be taken down, the company said. The policy includes the termination of accounts of anti-vaccine influencers. Tech giants have been criticised for not doing more to counter false health information on their sites. In July, US President Joe Biden said social media platforms were largely responsible for people's scepticism in getting vaccinated by spreading misinformation, and appealed for them to address the issue. YouTube, which is owned by Google, said 130,000 videos were removed from its platform since last year, when it implemented a ban on content spreading misinformation about Covid vaccines. In a blog post, the company said it had seen false claims about Covid jabs "spill over into misinformation about vaccines in general". The new policy covers long-approved vaccines, such as those against measles or hepatitis B. "We're expanding our medical misinformation policies on YouTube with new guidelines on currently administered vaccines that are approved and confirmed to be safe and effective by local health authorities and the WHO," the post said, referring to the World Health Organization."""
70
 
71
  model_name = "csebuetnlp/mT5_multilingual_XLSum"
@@ -73,7 +76,7 @@ tokenizer = AutoTokenizer.from_pretrained(model_name)
73
  model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
74
 
75
  input_ids = tokenizer(
76
- [article_text.replace("\n", " ").strip()],
77
  return_tensors="pt",
78
  padding="max_length",
79
  truncation=True,
 
64
  ## Using this model in `transformers` (tested on 4.11.0.dev0)
65
 
66
  ```python
67
+ import re
68
  from transformers import AutoTokenizer, AutoModelForSeq2SeqLM
69
 
70
+ WHITESPACE_HANDLER = lambda k: re.sub('\s+', ' ', re.sub('\n+', ' ', k.strip()))
71
+
72
  article_text = """Videos that say approved vaccines are dangerous and cause autism, cancer or infertility are among those that will be taken down, the company said. The policy includes the termination of accounts of anti-vaccine influencers. Tech giants have been criticised for not doing more to counter false health information on their sites. In July, US President Joe Biden said social media platforms were largely responsible for people's scepticism in getting vaccinated by spreading misinformation, and appealed for them to address the issue. YouTube, which is owned by Google, said 130,000 videos were removed from its platform since last year, when it implemented a ban on content spreading misinformation about Covid vaccines. In a blog post, the company said it had seen false claims about Covid jabs "spill over into misinformation about vaccines in general". The new policy covers long-approved vaccines, such as those against measles or hepatitis B. "We're expanding our medical misinformation policies on YouTube with new guidelines on currently administered vaccines that are approved and confirmed to be safe and effective by local health authorities and the WHO," the post said, referring to the World Health Organization."""
73
 
74
  model_name = "csebuetnlp/mT5_multilingual_XLSum"
 
76
  model = AutoModelForSeq2SeqLM.from_pretrained(model_name)
77
 
78
  input_ids = tokenizer(
79
+ [WHITESPACE_HANDLER(article_text)],
80
  return_tensors="pt",
81
  padding="max_length",
82
  truncation=True,