From f1fc0ef919a5f5190d7cad4377f45de22d6180d0 Mon Sep 17 00:00:00 2001 From: Manish Kumar Paul <56110316+manish2202@users.noreply.github.com> Date: Fri, 2 Oct 2020 23:19:51 +0530 Subject: [PATCH] A text summarizer and a speech to text converter A text summarizer and a speech to text converter using python. It is an application of NLP. --- Text Summarizer using Python | 33 +++++++++++++++++++++++++++++++++ 1 file changed, 33 insertions(+) create mode 100644 Text Summarizer using Python diff --git a/Text Summarizer using Python b/Text Summarizer using Python new file mode 100644 index 0000000..b752a44 --- /dev/null +++ b/Text Summarizer using Python @@ -0,0 +1,33 @@ + +/*code*/ + +from gensim.summarization.summarizer import summarize +from gensim.summarization import keywords +import wikipedia +import speech_recognition as sr + +wikisearch = wikipedia.page("Chandrayaan-2") +wikicontent = wikisearch.content +nlp = en_core_web_sm.load() +doc = nlp(wikicontent) +f.write(wikicontent) +f.close() + +summary=summarize(wikicontent, ratio = 0.06) +print("summary:") +print(summary) + +print("enter choice A for audio and S for summary") +ch = input() +if ch == 'A': + r = sr.recognizer() + with sr.Microphone() as source: + print("speak something.") + audio = r.listen(source) + print("okay,time up.") + try: + print("text:"+r.recognize_google(audio)) + except: + pass +if ch == 'S': + print(summary)