Skip to content

Christos-Hadjinikolis/feature-based_customer_review_mining

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

28 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Feature-based Customer Review Mining- An Implementation Solution Prototype

This project, summarises and explains the approach elaborated in [Kushal Bafna & Durga Toshniwal, 2013]. Its purpose is to serve as a prototype for an internal company project I am working on.

In general, the problem I intend to address is that of allowing for customers to extract objective review summaries relevant to a particular product, without having to go through the trouble of reading the whole set of available reviews.

The following sections, will cover the distinct steps that need to be followed. These concern: a) the identification of features of a product from customers' opinions, b) the extraction of opinions and the detection of their orientation or polarity relevant to each feature, c) the calculation of the final polarity of feature-opinions pairs, and d) the generation of feature based summarizations of the reviews, by through the extraction of the relevant excerpts with respect to each feature-opinions pair, and their placing into their respective feature based cluster.

The assumption is that these feature-based excerpts can easily be digested by the user.

Process

All steps are covered in the notebooks provided in the respective directory:

  • 000_data_inspection.ipynb
  • 001_data_normalisation.ipynb
  • 002_pos_tagging.ipynb
  • 003_zipfs_law.ipynb
  • 004_grouping_domain_synonyms.ipynb
  • 005_filtering_nouns.ipynb
  • 006_pairing_features_to_opinions.ipynb
  • 007_excerpts_extraction.ipynb

Example Outputs

A good example

In the Shadow of a Man

That an English woman scientist would journey to Tanzania to engage in this type of research is unusual and certainly puts her at "the top of her class".She follows the lives and behavior patterns of her subjects until her research sounds like a Michener novel with its generational emphasis and timelines of family heritage. The squabbles and fighting behavior could be that of any large Homo Sapien family. Jane Goodall deserves every accolade she gets for bringing us a lens through which to observe another geneological line of a species that has developed from our common ancestors.Her work suggests that we should rethink our medical research toward more humane treatment of these animals whose behavior is too similar to ours to ignore.

An average example

The Prophet

There is much that hints at his birth place, Lebanon where many of the old prophets walked the Earth and where this book project first germinated most likely.Probably becuase it was written in English originally, the writing flows, it is pleasant to read, and the charcoal drawings of the author decorating the pages is a plus. I believe that was my first taste of spirituality and seemed at the time more relevant than what I was being force-fed by nuns in catechism class. True wisdom comes from within.The prophet's teaching on love is particularly relevant to me at this stage of my life:" For even as love crowns you so shall he crucify you. Even as he ascends to your height and caresses your tenderest branches that quiver in the sun, So shall he descend to your roots and shake them in their clinging to the earth. He died of cancer in a New York hospital at the very young age of 48.The Prophet is a story about Almustafa (The Prophet) who after living 12 years in Orphalese is about to depart aboard ship to return to his home. There is no political, religious, or commercial enterprise attached to his name bent on winning souls and/or profits. They are written with the aim of being accessible and immediate to the reader and rely mostly on clear metaphors and vivid imagery.Copies of "The Prophet" are not hard to come by. A local seeress who knows him best asks him to share his wisdom so that it will endure for generations to come.So, he reveals his wisdom on love, birth, marriage, children, pain, talking, pleasure, death any so much more.It is a profound work, and here is his advice on marriage so you may judge for yourself:You were born together, and together you shall be forevermore.You shall be together when white wings of death scatter your days.Aye, you shall be together even in the silent memory of God.But let there be spaces in your togetherness,And let the winds of the heavens dance between you.Love one another but make not a bond of love:Let it rather be a moving sea between the shores of your souls.Fill each other's cup but drink not from one cup.Give one another of your bread but eat not from the same loaf.Sing and dance together and be joyous, but let each one of you be alone,Even as the strings of a lute are alone though they quiver with the same music.Give your hearts, but not into each other's keeping.For only the hand of Life can contain your hearts.And stand together, yet not too near together:For the pillars of the temple stand apart,And the oak tree and the cypress grow not in each other's shadow.Its not a little similar to theTao Te Ching: A New English Version (Perennial Classics)where a border guard recognises Lao Tzu, and asks him to share his wisdom as he goes into exile. Decadence is not suggested, but the basic purpose of Gibran's legacy is to tell us that life is short and must be lived without regrets.It is a book that includes such beautiful metaphors and velvetty language that you are always sucked into reading "just one more section. It states what any prophecy should, and allows the religious aspects of the beliefs to take the backseat to the love of life and aspirations.Buy, read, and live by The Prophet's words. This is a very usefull book that can be used as a secondary source for your primary religious texts. Gibran is justly famous for rich metaphors that brilliantly highlight the pursuit of Truth and Goodness amidst all the darkness and light of human nature.This is a book to read alone or with a partner, to give and receive, to go back to again and again.Note: the excerpts available in Amazon's "Search This Book" facility unfortunately do not do "The Prophet" justice, since only the book's introduction is included, whereas the wisdom does not begin unfolding until a bit later.

A bad example!

Honestly... this is not my fault! Some people just don't know when they have said enough!)

For Whome the Bell Tolls

However, as the story progresses, Hemingway's usage of the King James-style "Thee" and "Thou" to indicate that a more formal Spanish dialect is being used becomes distractingly gimmicky and wore quite thin by the end of the book. What little is left is a cause whose means and ends don't seem to differ from the alternative, and an appeal to virtues of loyalty to the band, or one's responsibility to follow his duty. The trouble is, these appeals are made among characters who Jordan - as Hemingway's voice - often considers untrustworthy, repugnant and treacherous. Another consistent theme found in Hemingway is courage under fire or dire circumstances, whether it is in the bull ring, behind enemy lines, or hunting man-eaters in the green hills of Africa. The chief protagonist is an American named Robert Jordon who has been tasked to blow up a bridge behind enemy lines in the Spanish mountains. Some say that Maria represents Spain and her gang rape represent the despoilage of Spain by the Fascists.Robert and Maria fall in love at first sight. Many Spanish words and phrases were translated literally word for word which gave a sense of the Spanish but sounds archaic and stilted to our English hearing ears. For example, the Spanish characters in the novel referred to each other as thee and thou. The traditional second person singular in English is "thou/thee/thy". Like Crane's The Red Badge of Courage, this book deals with the psychological and human ramifications of war.The hero is Robert Jordan, an American idealist fighting in Spain on the side of the Republic, or Communist, party. The quote from John Donne "never send to know for whom the bell tolls" looms ominously throughout the novel, and the battle of the bridge and the final, chilling moment of truth for Robert Jordan drives home the harrowing fact that is the reality of war: "it tolls for thee. Hemingway's magnificent novel has something for everyone: an action tale, an anti-war protest, a love story, subtle ironies, a magnificent short story within the novel, political criticism of communism and fascism, a philosophy of life, and beautiful descriptions of life that leave you gasping. But with the action packed into that time and extensive use of flashbacks, it becomes a tapestry of all humankind. After you start to notice the individual threads in the tapestry, be sure to step back and see the whole. For the remarkably balanced and connected artistry of the themes and directions in the story is what makes this book great.If you are disturbed by descriptions of violence, brutality, and inhumanity, you will not enjoy this book.Robert Jordan is an American who has joined the republican side of the Spanish civil war. Now, he is transformed into a demolitions expert who can blow up trains and bridges. The reader is given a fascinating in-depth look into his psyche, where he reflects on his fellow soldiers, plans for warmaking and the justifications and rationalizations along the war trail.Pablo's another character who is burned into your consciousness long after you've finished reading. There is an incredible flashback story detailing Pablo's orchestration of the sadistic torture and humiliation of a group of wealthy fascist sympathizers. The vivid description involved in this passage is nothing short of extraordinary.Of course the true democrats, fighting for the Republic against the well financed and better armed fascist military, eventually lose the war, but having that foreknowledge does nothing to detract from the cliff-hanger like feelings brought about by the various battles and journeys the rebel crew embarks on. This is the best, and most accessible of all of Hemingway's works. He doesn't appear to be completely sold on this cause in Spain, and while he seemingly never leaves this area physically, mentally he challenges the essence of being there time and time again so he can reassure himself that this is the just thing to do, and for the right cause.This is not an easy read in the sense that there is much more to what is going on than meets the eye. (The Western democracies - who might have prevented Spain from going fascist - followed a pusillanimous "hands off" policy which only emboldened the insurgents and their supporters.) Into this vortex came many writers and intellectuals. From this self-inflicted literary ambush there is no escape for Hemingway: you either need excellent descriptive prose or superb psychological insight to carve a good story from such crooked timber, for, after all, what else is left to describe in such a situation save inner musings and the outer landscape?The prose is the next problem. 174]"So a woman like that Pilar practically pushed this girl into your sleeping bag and what happens? And of course, "For Whom The Bell Tolls," set against the brutal violence of the Spanish Civil War, is probably the definitive work of fiction about this pivotal period in European, and world history.Generalissimo Francisco Franco's fascist troops invaded Spain in July 1936 in order to overthrow the newly established Republic headed by the Popular Front, (composed of liberal democrats, socialists, anarchists, trade unionists, communists and secularists. )The country was basically divided into Red Spain - the Republicans, and Black Spain, represented by the landed elite, committed to a feudal system and Franco's cause, Fascists, the urban bourgeoisie, the Roman Catholic Church, and other conservative sectors. Those who fought with the Abraham Lincoln Brigade, from 1937 through 1938, believed the defense of the Republic represented the last hope of stopping the spread of international fascism. Most of the volunteers were not political, but idealists who were determined to "make Madrid the tomb of fascism. Hemingway's protagonist Robert Jordan, an American professor of Spanish from Missoula, Montana, was one such volunteer. Robert Jordan, an explosives expert, has been ordered to make contact with a small band of partisan fighters in the Guadarrama Mountains of fascist controlled southern Spain. He undergoes several changes during the 3 days and 3 nights in which the story takes place. Pilar is Pablo's woman, an extremely strong and savvy person, she is steeped in gypsy lore and superstition, and is probably the novel's most colorful character. When Robert Jordon joins them, Pilar takes the leadership position over from Pablo, whom she no longer trusts, but still loves. Pilar, relates various war stories, and anecdotes, which reflect the cruelty and inhumanity of civil war.María's life was shattered by the outbreak of the war. Since her mother was not a Republican, but a devout Catholic, she shouted, "Viva my husband, the town's mayor," before she died, rather than the more typical, "Viva La Republica!" Hemingway worked as a correspondent in Spain during the Civil War, as a reporter for the North American Newspaper Alliance (NANA). When it comes to men at war, the book shines.A technique that I found interesting was the way that Hemingway created the absent character of Kashkin. The sex, the declarations of love, the intimacy, it all seems hollow.In every other place in the novel there is complexity, nuance. And in a novel that creates such a real portrait of war and moral ambiguity; complexity in loyalty, politics, allegiance, nationality, and idealism, to offer the reader such an ordinary, pop-song rendition of love nearly justifies skipping every section where one sees the words "little rabbit. "Hemingway attempts to integrate language into the story by employing the occasional Spanish word along with an antiquated sort of English, full of thou and thee. The whole novel, except for some flashbacks and reminiscences of various characters, covers just a few days.Although the novel focuses on a small number of characters in a fairly compressed time period, Hemingway attains a real epic feel with this book. It offers a compelling perspective on war from the viewpoint of guerrilla forces, rather than conventional forces (interested readers might want to check out Mao Tse-Tung's "On Guerrilla Warfare" for some theoretical and historical perspective). Other significant issues include loyalty, leadership, communications, military hardware, the impact of weather and terrain, and the connection between guerrilla and conventional forces. The novel follows his experiences with a band of guerrilla fighters as he undertakes a mission to blow up a strategic bridge. Thus the book should interest not just lovers of literature, but also serious military professionals and students of the history of warfare.Hemingway offers a grim and graphic look at the brutality of 20th century warfare. In Hemingway's world storytelling is as essential a human activity as eating, fighting, and lovemaking.Hemingway's writing appeals to all the senses as he creates some vivid scenes. For intriguing companion texts that also deal with the Spanish Civil War, I recommend "Spain's Cause Was Mine: A Memoir of an American Medic in the Spanish Civil War," by Hank Rubin, and "The Confessions of Senora Francesca Navarro and Other Stories," by Natalie L. M. Petesch. Once the fiercest of the Republicans, he is now well-fed and content in his mountain hideaway, has a dozen or so horses that make him rich, and knows that the actions contemplated by Roberto will bring an end to his safety. She describes in memorable detail her love affair with a matador in Valencia, and how she drank cold beer with the sweat dripping off the glass while he napped in the room behind her. Along the way Jordan will learn the revolting pasts of several of the guerrillas, fall in love with one of them, and spend quite some time meditating on "truths" he was once sure he knew.No sooner has Jordan met with the guerrillas than he discovers that one of them, fearful of being hunted down by the fascist forces, stands against him and threatens to take the entire group away. Even as they curse and spit at the fascists several of these guerrillas communicate, through their stories, arguments against the futility and cruelty of the war they have willfully taken up. The answers are so well bound with the narrative that often one hardly notices a metaphysical discussion has occurred, but those who give the text a second look will find a philosophical subtext as gripping as the plot line.As for the story, Hemingway creates out of his assortment of characters a narrative of breathtaking beauty. Jordan, an American, is in Spain fighting on the side of the Republicans in 1937 during the Spanish Civil War. He is a Spanish teacher from Montana who loves Spain, and is fighting, carrying out explosives missions, against the Fascists, who have a vast war machine.At the beginning of the novel, Robert Jordan is teamed up with a band of guerrilla fighters in the mountains near a bridge he must blow as part of a Republican offensive. Other members of the band include Pablo, a formerly great fighter, we are told, who has now "gone bad." He cares primarily for his horses. The story is brutal and demonstrates the atrocities committed by the Republicans in the war as they bludgeon the town's Fascists to save bullets. She is the "love interest."I love Hemingway's voice, and this novel continues to demonstrate his ability, with that spare, journalistic style, to narrate loneliness like no one else. The seemingly simplistic style evokes a real pathos, and is especially suited to writing of war and the human spiritual conflicts such situations impose upon its participants. I laughed allowed at the absudities, but was struck by the dire consequences of these ridiculous desicions and actions. These situations show the war machine's indifference to individual human life and the ridiculous scenarios that arise from various leaders' individual conceits and worries.I think that the book's time frame of only three days makes a strong point about war and the people one serves with. For the reader, the band in the mountains are basically the only people Robert Jordan knows (though there are brief flashbacks). Perhaps the bell tolled for Ernest and his bid for literary greatness with the passing of this book. To the extent that Hemingway wanted to reach the apex of truth in storytelling, and to find a suitable language to express it, this book is a great achievement. Hemingway chooses Spanish modulation of English words to power his narrative - from the start, the reader senses the honor, strength, and spirit every sentence spoken carries with it.Ernest is not just translating from Spanish to wow us; the reader feels that when he wrote this book, Spanish was the only language that could express his happiness, his sadness, his pleasure and suffering. Maybe Spanish contained the words and meanings Hemingway and those involved in the war for Spanish liberty sought desperately every night by the campfire - words of fear and love.To me, this book was Hemingway's most significant attempt at articulating his life philosophy. You might argue that El Sordo's last stand is followed by Hemingway's personal literary last stand - against fascism, fear, and life's various illusions.

About

Feature-based Customer Review Mining- An Implementation Solution Prototype

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published