Skip to content

Convert the text of articles to speech using nltk, newspaper and gTTS with Python.

License

Notifications You must be signed in to change notification settings

MeqdadDev/articles-text-to-speech

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Articles text to Speech

Repo Banner

By: Meqdad Darweesh

Convert the text of articles to speech using nltk, newspaper and gTTS with Python.

What I did?

In this code, I've used Python with multiple libraries:

nltk

Natural Language Toolkit, visit: https://www.nltk.org/

gTTS

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

newspaper library, visit: https://newspaper.readthedocs.io/en/latest/

Output sample:

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

License

MIT