Commit 6ada7a29 authored by chalikaM's avatar chalikaM

update

parent 3baeb9bb
......@@ -18,16 +18,16 @@ Certain diseases like Malaria are caused due to global warming since there is th
I would like to conclude my global warming speech by saying that the international community, where does they governments and citizens has to come forward to reduce your carbon footprint to save the planet for our future generation. All of us living here are the stakeholders of nature and we are responsible for how we take care of our environment. As the saying goes, charity begins at home, we have to start using biodegradable materials at our houses, reduce plastic waste and other such changes in our lifestyle so that we can make an impact to reduce global warming globally."""
totalCharacterCount = len(speech)
# print(">>>Total character count<<<")
# print(totalCharacterCount)
print(">>>Total character count<<<")
print(totalCharacterCount)
conclusionCharacterCount = (85/100)*totalCharacterCount
# print(">>>Character count for the conclusion<<<")
# print(conclusionCharacterCount)
print(">>>Character count for the conclusion<<<")
print(conclusionCharacterCount)
conclusion = (speech[int(conclusionCharacterCount):int(totalCharacterCount)])
# print(">>>Conclusion<<<")
# print(conclusion)
print(">>>Conclusion<<<")
print(conclusion)
final_words = []
......
......@@ -19,16 +19,16 @@ I would like to conclude my global warming speech by saying that the internation
totalCharacterCount = len(speech)
# print(">>>Total character count<<<")
# print(totalCharacterCount)
print(">>>Total character count<<<")
print(totalCharacterCount)
introductionCharacterCount = (15/100)*totalCharacterCount
# print(">>>Character count for the introduction<<<")
# print(introductionCharacterCount)
print(">>>Character count for the introduction<<<")
print(introductionCharacterCount)
introduction = (speech[0:int(introductionCharacterCount)])
# print(">>>Introduction<<<")
# print(introduction)
print(">>>Introduction<<<")
print(introduction)
final_words = []
......
......@@ -15,10 +15,11 @@ Topic = nlp("dog")
Content = nlp("The dog is a pet animal. A dog has sharp teeth so that it can eat flesh very easily, it has four legs, two ears, two eyes, a tail, a mouth, and a nose. It is a very clever animal and is very useful in catching thieves. It runs very fast, barks loudly and attacks the strangers. A dog saves the life of the master from danger. One can find dogs everywhere in the world. Dogs are a very faithful animal. It has a sharp mind and a strong sense of hearing smelling the things. It also has many qualities like swimming in the water, jumping from anywhere, good smelling sense.")
stopwords = list(STOP_WORDS)
# doc = nlp(Content)
# Topic = "dog"
# content = "The dog is a pet animal. A dog has sharp teeth so that it can eat flesh very easily, it has four legs, two ears, two eyes, a tail, a mouth, and a nose. It is a very clever animal and is very useful in catching thieves. It runs very fast, barks loudly and attacks the strangers. A dog saves the life of the master from danger. One can find dogs everywhere in the world. Dogs are a very faithful animal. It has a sharp mind and a strong sense of hearing smelling the things. It also has many qualities like swimming in the water, jumping from anywhere, good smelling sense."
#
#
# doc = nlp(content)
# Tokenization
# tokens = [token.text for token in Content]
......@@ -43,7 +44,8 @@ print(word_frequencies)
topicWords = []
for words in Topic:
topicWords.append(words)
topicWords.append(words.text)
print(topicWords)
......@@ -51,26 +53,19 @@ keyWords = []
for word in word_frequencies.keys():
if word_frequencies[word] >= 3:
print(word)
# print(word)
keyWords.append(word)
print(keyWords)
for token1 in keyWords:
for token2 in topicWords:
print("similarity", token1.similarity(token2))
Total_similarity = Total_similarity + token1.similarity(token2)
# Total_similarity = 0
#
# for token1 in keyWords:
# for token2 in topicWords:
# print((token1, token2), "similarity:")
# similarity = SequenceMatcher(None, token1, token2)
# Total_similarity = Total_similarity + similarity.ratio()
#
#
#
#
# print(len(Content))
# print(Total_similarity)
# average_similarity = Total_similarity/len(Content)
# print(average_similarity)
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