Commit c2152a19 authored by chalikaM's avatar chalikaM

SPEECH CONCLUSION PROCESSING

parent 047fbb4e
import sys
from operator import index
import spacy
import textacy
#Identify words that are in a introduction
nlp = spacy.load("en_core_web_sm")
s = " where does he go few moments ago he went once upon a time asdasd dwref ADSADSADA Hello i'm Gabi :D he asked me to do it i said good bye to him he replyed fot itgoodbye asd asl a he started running. once upon a time he went to the let me briefly temple."
totalCharacterCount = len(s)
print(totalCharacterCount)
conclusionCharacterCount = (85/100)*totalCharacterCount
print(conclusionCharacterCount)
conclusion = (s[int(conclusionCharacterCount):int(totalCharacterCount)])
print(conclusion)
final_words = []
words = ["according to a study", "according to a research","according to a review","according to a survey","according to an analysis","according to one study","according to research","according to an investigation","let me briefly"]
for wordPharse in words:
if wordPharse in conclusion:
final_words.append(wordPharse)
print(final_words)
doc = nlp(conclusion)
patterns = [[{"POS": "ADV"}, {"POS": "AUX"}, {"POS": "PRON"}], [{"POS": "ADV"}, {"POS": "AUX"}, {"POS": "NOUN"}]]
verb_phrases = textacy.extract.token_matches(doc, patterns)
# print(s[0:introductionCharacterCount])
for verb_phrases in verb_phrases:
print(f"Identified questions : {verb_phrases}")
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment