Python Forum
Text Summarization CSV File - Printable Version

+- Python Forum (https://python-forum.io)
+-- Forum: General (https://python-forum.io/forum-1.html)
+--- Forum: News and Discussions (https://python-forum.io/forum-31.html)
+--- Thread: Text Summarization CSV File (/thread-21933.html)



Text Summarization CSV File - Shivi_Bhatia - Oct-21-2019

HI All,

I have a CSV file with 100+ rows of text. These text are conversation between a person and chat bot. I need to create a summary of each line item separately.While i am able to do a summary on a text file using gensim package however as each line item is a distinct conversation hence i cannot create a corpus of all these documents. While this text file is just 100 off the final data is from a server which rolls in thousands hence running each summary separately is also a very cumbersome approach. Kindly suggest as i am not figure out to run it on csv data:
Below

[import gensim
from gensim.summarization import summarize



my_text = "Customer: My name is Jerrie. Agent: Hello Jerrie, how are you doing? Customer: I have been checking online with your website and you have number of different offers for credit card and balance transfer offers and purchase offers and i feel as a loyal customer i should be offer that but I haven’t been and i just don’t think it is very fair and its quite frustrating . Agent: okay let me check that for you . Agent: I certainly understand your frustrations Mrs. Coles. What I can offer you is to be transferred over to our platinum card it has number of benefits . 0% intro new purchases offer – 28 Months. 0% intro balance transfer offer last for 18 Months. 0% on Overseas Purchase. 0% Cash Fee for FOREX : Post Office Travel Money . Customer: Okay and do I need to do different things in regards to that or how would I get started with the process?. Agent: No I can process this all for you after this you will be able to process the balance transfer. Customer: Okay. Agent: okay thank you for calling, Is there anything else I may help you with?"



my_text.split() # split each word
len(my_text.split()) # find total words
my_text.split()



summarize(my_text)

# Set the Amount you want to summarise
#default is 20%
a= summarize(my_text, ratio=0.5)
len(a)

# We can also ask to summarise at the number of words rather than ratio
summarize(my_text, word_count=80)
]