2

In my assignment, here I use SharpNLP to define part of speech, like noun, adjective, verb and so on. Then, i wanna classify sentence based on kind of tenses, firstly in this case, PAST TENSE as example.

Let see my code..

        listSentence = ParseInput(allInput);

        foreach (string word in listSentence[0].Split(separator))
            if (word.Trim() != "")
                listWord.Add(word);  

        string[] lWord = listWord.ToArray();
        string[] lPOS = this.NLP.PosTagTokens(lWord);

allInput = "I was busy yesterday."

Takes it simple, in listSentence[0] contains "I was busy yesterday".
Then split into "I", "was", "busy", "yesterday" in string[] lWord
Then I used SharpNLP, that's running well so that string[] lPOS contains {"NN", "VBD", "JJ", "NN"}
That should be recognized as TRUE
Based on that output, I'm confused how to recognize as PAST TENSE - TRUE or FALSE.

Explanation :

NN : Noun, singular or mass
VBD : Verb, past tense
VBP : Verb, non-3rd person singular present
VBZ : Verb, 3rd person singular present
VBG : Verb, gerund or present participle
VBN : Verb, past participle
JJ : Adjective
PRP : Personal Pronoun

If allInput = "I am busy yesterday"
string[] lPOS = {"PRP", "VBP", "JJ", "NN"}
That should be recognized as FALSE

If allInput = "They am busy yesterday"
string[] lPOS = {"PRP", "VBP", "JJ", "NN"}
That should be recognized as FALSE

If allInput = "I was busy tomorrow"
string[] lPOS = {"PRP", "VBD", "JJ", "NN"}
That should be recognized as FALSE

Sir, please help me. Give me idea, and rules to recognize past tense based on all output above. Let me learn by your example. Thanks a lot all. :) :)

Srikanth Venugopalan
  • 9,011
  • 3
  • 36
  • 76
  • 2
    How the third case FALSE? Based on what are you going to classify a sentence as PAST or PRESENT. – vishnu viswanath Apr 03 '13 at 13:37
  • Sir @Sonic.. I'm going to classify a sentence as PAST or PRESENT based on VERB and ADVERB of TIME perhaps.. Any suggestion Sir @Sonic? – Berry Harahap Apr 03 '13 at 13:46
  • 1
    I was busy tomorrow. Shouldn't it return TRUE since was is VBD and it is past-tense? – vishnu viswanath Apr 03 '13 at 14:21
  • "was" indicate past tense, but adverb "tomorrow" indicate future. That's contrary between verb "was" and adverb "tomorrow", and should be conclude as FALSE.. I think, adverb can be reference to define FALSE or TRUE.. :) :) :) – Berry Harahap Apr 03 '13 at 14:26
  • I cant help you since 'tomorrow' although it is adverb in this case -3 is recognized as NN which stands for noun.Other wise you could have created a map for the types such as VBD to their tense PAST FUTURE etc and iterated through it. – vishnu viswanath Apr 03 '13 at 14:50

1 Answers1

0

There is a basic contradiction in the goal. The parser operates at the syntactic(structure) level. But you want to classify based on semantics(meaning) as well.
I was busy tomorrow is past tense according to the parser, because syntactically, there is a verb in past tense. But, the semantics of the last word, makes it a semantically wrong sentence.

In my opinion, for your goal, I am busy yesterday is Present tense and I was busy tomorrow is past tense.

menakas
  • 376
  • 2
  • 7