By: Meqdad Darweesh
Convert the text of articles to speech using nltk, newspaper and gTTS with Python.
In this code, I've used Python with multiple libraries:
Natural Language Toolkit, visit: https://www.nltk.org/
Google Text-to-Speech, a Python library and CLI tool to interface with Google Translate's text-to-speech API. For more details, visit: https://gtts.readthedocs.io/en/latest/
newspaper library, visit: https://newspaper.readthedocs.io/en/latest/
In this code example, I've used this article: Coronavirus: How can AI help fight the pandemic? from BBC News.
First 250 character of the article:
Image copyright Getty Images Image caption There is growing fear about the spread of the virus
Executives from Amazon, Google, Microsoft, Apple and Facebook met officials at Downing Street on Wednesday to discuss their role in
the coronavirus crisis
You can check the audio file as a result of this execution.
Meqdad