Creation of a dataset from a list of text data

Hi all,

I am new to the datasets library. I have a list of text. Example is shown below:

[', A MESSAGE IS being shared across Facebook and WhatsApp claiming that criminals are handing out chemically-laced facemasks to members of the public so they can drug and rob them., The rumour, which started on Facebook, reads:, “WARNING A new thing circulating now. People are going door to door handing out masks. They say it’s a new initiative from local government. They ask you to please put it on to see if it fits. It’s doused with chemicals which knocks you out cold. They then rob you!! Please DO NOT accept masks from strangers. Remember friends, it’s a critical time and people are desperate, the crime rate will spike. Please be cautious & safe!!”, The screenshot in question., The message, which does not name any specific locations, has been shared thousands of times around Ireland and the UK as well as in the US and parts of south-east Asia., An Garda Síochána, when asked for evidence as to whether the message was false which would help to stop it from being spread, instead initially refused to answer the question., A spokesperson said: “An Garda Síochána do not comment on third-party social media sites., “Any member of the public should report criminal activity to An Garda Síochána and not on social media., “An Garda Síochána will treat any reports of this type of activity seriously. Clear public information messages are required at this time and An Garda Síochána request that media do not inadvertently propagate social media myths or fake news at this time.”, In follow-up correspondence, gardaí said they needed an exact time and date of an alleged incident to check the internal garda Pulse system. As this was not forthcoming, they could not outright debunk the claims., However, they did say that an incident such as the one described in the message would have been logged and senior officers in charge of the Covid-19 garda reaction would have been informed. This has not been the case., Further, a check of local and national news sources around Ireland also shows that there have been no reports of any such incidents taking place., TheJournal.ie also carried out a search on social media for anyone describing such an incident happening to them or someone known to them, in case there was an example which had not been reported to gardaí or covered by the media. In an extensive search, no such examples could be found., , Other countries, A number of police forces around the world have already commented on the exact same claim when it was circulating in the countries in which they operate., The news wire Reuters\\xa0dismissed the claim as false at the start of this month. That news organisation contacted police forces across the UK who effectively said the same thing as gardaí – that there is no evidence whatsoever to support the claim that this is happening., The US fact-checking organisation Politifact also looked into the claim and found no evidence from police, and no reports in the media, of this ever happening in America., Reporters in Taiwan and in Singapore\\xa0have debunked the same claim, with police in both countries reporting no evidence that any incidents of this kind had taken place., There is not one shred of evidence that this is happening in Ireland or anywhere in the world. The fact that the exact same message has been shared in a significant number of countries also dilutes any chance that it might have a sliver of truth to it., However, gardaí have warned the public that there are scams in operation around the country and advised the public to be wary of anyone who comes to their door. The advice is to always ask for the ID of someone selling something door-to-door. You can read more on the various Irish coronavirus scams in operation here., , ***, ***, There is a lot of false news and scaremongering\\xa0 being spread in Ireland at the moment about coronavirus. Here are some practical ways for you to assess whether the messages that you’re seeing – especially on WhatsApp – are true or not., STOP, THINK AND CHECK, Look at where it’s coming from. Is it someone you know? Do they have a source for the information (e.g. the HSE website) or are they just saying that the information comes from someone they know? A lot of the false news being spread right now is from people claiming that messages from ‘a friend’ of theirs. Have a look yourself – do a quick Google search and see if the information is being reported elsewhere., Secondly, get the whole story, not just a headline. A lot of these messages have got vague information (“all the doctors at this hospital are panicking”) and don’t mention specific details. This is often – but not always a sign – that it may not be accurate., Finally, see how you feel after reading it. A lot of these false messages are designed to make people feel panicked. They’re deliberately manipulating your feelings to make you more likely to share it. If you feel panicked after reading something, check it out and see if it really is true., TheJournal.ie’s FactCheck is a signatory to the International Fact-Checking Network’s Code of Principles. You can read it\\xa0here.\\xa0For information on how FactCheck works, what the verdicts mean, and how you can take part, check out our Reader’s Guide\\xa0here. You can read about the team of editors and reporters who work on the factchecks\\xa0here, , To embed this post, copy the code below on your site, 600px wide\\n<iframe width="600" height="460" frameborder="0" style="border:0px;" src="https://www.thejournal.ie/https://www.thejournal.ie/debunked-facemasks-chemicals-criminals-5074334-Apr2020/?embedpost=5074334&width=600&height=460" ></iframe>, 400px wide\\n<iframe width="600" height="460" frameborder="0" style="border:0px;" src="https://www.thejournal.ie/https://www.thejournal.ie/debunked-facemasks-chemicals-criminals-5074334-Apr2020/?embedpost=5074334&width=400&height=460" ></iframe>, 300px wide\\n<iframe width="600" height="460" frameborder="0" style="border:0px;" src="https://www.thejournal.ie/https://www.thejournal.ie/debunked-facemasks-chemicals-criminals-5074334-Apr2020/?embedpost=5074334&width=300&height=460" ></iframe>, Facebook, Twitter, , Access to the comments facility has been disabled for this user, Notify me of followup comments via e-mail, TheJournal.ie supports the work of the Press Council of Ireland and the Office of the Press Ombudsman, and our staff operate within the Code of Practice.  You can obtain a copy of the Code, or contact the Council, at www.presscouncil.ie, PH: (01) 6489130, Lo-Call 1890 208 080 or email: info@presscouncil.ie, Please note that TheJournal.ie uses cookies to improve your experience and to provide services and advertising. For more information on cookies please refer to our cookies policy., News images provided by Press Association and Photocall Ireland unless otherwise stated. Irish sport images provided by Inpho Photography unless otherwise stated. Wire service provided by Associated Press., Journal Media does not control and is not responsible for user created content, posts, comments, submissions or preferences. Users are reminded that they are fully responsible for their own created content and their own posts, comments and submissions and fully and effectively warrant and indemnify Journal Media in relation to such content and their ability to make such content, posts, comments and submissions available. Journal Media does not control and is not responsible for the content of external websites., Switch to Mobile Site, Sites:\\n                    TheJournal.ie |\\n                    Noteworthy |\\n                    The42 |\\n                    Fora |\\n                    Boards.ie |\\n                    Adverts.ie |\\n                    Daft.ie, , , , , , TheJournal.ie Latest News Feed, "Debunked: Theres no evidence that criminals are dousing facemasks with chemicals so they can rob people Comments", Create an email alert based on the current article',
 'Speak Now, The Covid-19 pandemic has claimed the lives of several health workers across the world. These were people treating patients infected with coronavirus. A recent report says more than 60 doctors have died in Italy during the outbreak., Amid this, an emotional post is circulating on social media showing a man lying on a hospital bed and giving the thumbs-up sign to health care workers standing near him. It is being claimed that this is 38-year-old Italian doctor Julian Urban, waving goodbye to co-doctors as he is about to die due to coronavirus., "India Today Anti Fake News War Room (AFWA) has found the claim along with the photo to be untrue. The photo was taken in a hospital in Chinas Wuhan when a team of doctors was treating a Covid-19 patient.", AFWA probe, Facebook user "Thila Balasubramaniyan" shared the image with the caption, "They are saying their final Goodbyes to love ones Not because of Exotic food eating habits, not because of travelling despite Lockdown, not because of going against Goverment rules and regulations or Not because of going againts Nature. They are dying because they have done nothing but chose to be a DOCTOR !", On the viral image is superimposed the following text: "A 38-year-old Italian Doctor waves Goodbye to co-doctors as he could no longer survive Coronavirus Dr. Julian Urban. A 38 year-old doctor serving in a hospital in Lombardy, Italy Sends his last words to co-doctors." The archived version of the post can be seen here., The misleading post has been shared widely on social media. We found that the screenshot shared in the viral post was of an article from a website called "Magical Earth"., Some other dubious websites (https://www.faithpot.com/atheist-doctor-finds-god-covid-19/) have also carried the story with the same photo., Using reverse search, we found that the viral photo has been used by many credible news websites. As per "Buzzfeed", the photo was taken at Hankou hospital in Wuhan on January 27, 2020., A report by "South China Morning Post" also carries the viral photo with the caption, "Doctors in Wuhan are working around the clock and against the odds to battle the coronavirus outbreak.", None of the credible news reports, carrying the viral photo, says that the patient seen here is himself a doctor. AFWA could not independently verify the story of an Italian doctor named Julian Urban who died after waving goodbye to his co-doctors. But it is clear that the viral photo is not from Italy but China., , The number of crows determines the intensity of the lie., , What happened in Galwan: Detailed account of brutal June 15 battle, Exclusive: Images from Galwan show Chinese build-up intact after carnage, India holds fort, India-China border dispute: Importance of Pangong Tso and why its fingers are much sought after, Covid-19 Tracker: State-wise data, daily trends, patients cured, deaths and more, "Watch: Army treating Pangong Tso flashpoint as semi-permanent faceoff", Tuticorin custodial deaths: Eyewitnesses recall horrifying details, Tuticorin custodial deaths: Does lockdown mean police raj in Tamil Nadu?, Attempts to alter status-quo can have repercussions: Indian envoy to China, Amid border tension, IAF, Army conduct massive exercise in Ladakh, Back at work: Covid survivor shares pro tips, "Pangong Tso: Satellite images show Chinas increased presence between finger 4 and 8", Chinese-sponsored Cyber attacks: Can India build firewall against hackers?, , Copyright © 2020 Living Media India Limited. For reprint rights: Syndications Today, Copyright © 2020 Living Media India Limited. For reprint rights: Syndications Today',
 'Responding to comments on his own post, the author says he got the information from KTN News, a television news bulletin broadcast by Nairobi-based Standard Media Group. He makes no mention of the research it is based on or the organisation that conducted it., Pesacheck got in touch with KTN News, who confirmed that they published a story by Reuters, on their print publication, The Standard. The story, however, shines a spotlight on the plight of expectant women in malaria-prone areas during the COVID-19 pandemic given that pesticide spraying to kill mosquitoes has been suspended due to lockdowns., According to the article, a combination of these factors is what puts them at a higher risk of contracting both malaria, COVID-19 or even vulnerable to misdiagnoses as the two diseases carry similar symptoms, rather than the mere fact that they are pregnant as claimed., Although pregnancy does cause changes in the body and immune system, making expectant mothers more susceptible to some respiratory infections, the World Health Organization (WHO) says there is currently no evidence that they are more prone to COVID-19 than the general population., WHO adds that research is still underway to understand the full impact of COVID-19 infection on pregnant women, but in the meantime, urges them to take the same precautions to avoid the virus as other people., These include washing hands with soap or sanitising with an alcohol-based rub, maintaining social distancing, avoiding touching eyes, nose and mouth, and seeking medical attention early if one has a fever, cough or difficulty in breathing., There is also no evidence that COVID-19 can be passed from an expectant mother to her child either during pregnancy, at the time of delivery, or through breastfeeding., PesaCheck has looked into the claim that pregnant mothers are prone to COVID-19 and finds it to be FALSE., This post is part of an ongoing series of PesaCheck fact-checks examining content marked as potential misinformation on Facebook and other social media platforms., By partnering with Facebook and similar social media platforms, third-party fact-checking organisations like PesaCheck are helping to sort fact from fiction. We do this by giving the public deeper insight and context to posts they see in their social media feeds., Have you spotted what you think is fake news or false information on Facebook? Here’s how you can report. And, here’s more information on PesaCheck’s methodology for fact-checking questionable content., This fact-check was written by PesaCheck Fact-Checker Simon Muli and edited by PesaCheck Deputy Editor Rose Lukalo., The article was approved for publication by PesaCheck Managing Editor Eric Mugendi., PesaCheck is East Africa’s first public finance fact-checking initiative. It was co-founded by Catherine Gicheru and Justin Arenstein, and is being incubated by the continent’s largest civic technology and data journalism accelerator: Code for Africa. It seeks to help the public separate fact from fiction in public pronouncements about the numbers that shape our world, with a special emphasis on pronouncements about public finances that shape government’s delivery of Sustainable Development Goals (SDG) public services, such as healthcare, rural development and access to water/sanitation. PesaCheck also tests the accuracy of media reportage. To find out more about the project, visit pesacheck.org., PesaCheck is an initiative of Code for Africa, through its innovateAFRICA fund, with support from Deutsche Welle Akademie, in partnership with a coalition of local media and other civic watchdog organisations in 14 African countries., Written by, Written by']

My development environment is google colab and
before using the datasets library I installed the datasets library using:

!pip install datasets

Also, imported the library as shown below:

from datasets import Dataset
X_train_set = Dataset.from_list(X_train_L)

Executing that cell produces an error as hown below in the screenshot:

I am wondering what this error (‘str’ object has no attribute ‘get’) means?

I am doubting the kind of format my list of text that I am passing to the from_list() of the Dataset object. Is the list in the right format?

How do I resolve this?

Thanks,

Ron

Hopefully this helps someone out there like me who is learning how to use the Dataset object from the datasets package.

Anyway, I was able to figure out the kind of list the from_list() method expects, you will need to pass a list of dictionary type into create your dataset.

Example:
You will need to prepare a list of dictionaries:
[{‘label’: 0,‘text’: ‘A MESSAGE IS being shared across Facebook and WhatsApp claiming’}, {‘label’: 1, ‘text’: ‘Speak Now, The Covid-19 pandemic has…’}]

This is the kind of list you pass as a parameter to the from_list() method.

Hopefully, that helps!

Ron