I have to write a code that takes a few lines of comments about a product such as product based on adjectives Describe the product in the review as input and rate. I have just used POS Tagger to tag the parts of the speech of every comment. Now, I have to choose the adjectives that describe the nouns, and if a product appears to be related to the product, then I have to consider the adjective. This is the code that I have used for pOS tagging. It works just fine. I want a way to move forward A simple solution that you will find a long way to use dependency parser, which includes Stanford The core algorithm with NLP goes like this: Input: Assume that the review cars are about the last two dependencies in the goal name WARNING: This is a high-precise search algorithm instead of high memory, your keyword list will never be completed, so it is possible that you remember some adjectives. Besides, the parser is not right and will sometimes make mistakes. In addition, the pars As you can see, there is no single Edit after comment by OP: Yes, Import java.io. *; Import edu.stanford.nlp.tagger.maxent.MaxentTagger; Public category tags {public static zero main (string [] args) throws IOException, ClassNotFoundException {string tag; // Tagger MaxentTagger tagger = new MaxentTagger ("edu / stanford / nlp / model / pos-tagger / wsj-left3words / wsj-0-18-left3words-distsim.tagger" start); FileInputStream fstream = New FileInputStream ("src / input.txt"); BufferedReader br = new BufferedReader (new InputStreamReader (fstream)); Fluorooter q = new fleeter ("src / output.txt", true); Buffed Worker Out = New Baffed Vitter (Q); String sample; // We will now take the sentence by line from file.txt file and store it in string sample while ((sample = br.readline ())! = Null {// tag tagging string tagger.tagString (sample); System.out.print (marked in "+ \ n"); // write it into the output file. tag in. Tag (tag); Out.newLine (); } Out.close (); }}
amod relationship in the output of the dependency parser, in which you are interested in the noun is included. Using the example:
I have a long glass and just bought a big red car.
amode dependence:
amode (glass-5, long -4) amod (car-12, big -10 Amod (car-12, red-11)
car , and you The adjective that is looking for is therefore
large and
red .
amode relationship is an adjective in many ways that can describe a noun to an adjective. For example,
"car is red" as
det (car-2, the-1) nsubj (red-4, car- 2) Police (Red-4, I-3) Root (root-0, red-4) conjund (red-4, black-6) nsubj (black-6, car-2)
amode relationship, just one copala and combination. You are trying to remove the fact that
the car is red and
the car is black whether you want to do it up is up to your present form, when This algorithm gives an adjective, you can certainly be confident that it is actually describing a noun. This is a good feature in my opinion, but it depends on the case of your use.
I bought a new car. and
This is awesome. There are two separate sentences and will be parsed separately. Known as this problem, it has been found that Stanford also supports it - see. I have not used any of these systems in Java, but there are very useful online demos at the same time, by entering the two sentences given above, I will
[ I] bought [a new car] 2 [this] 2 is awesome
No comments:
Post a Comment