def Interpretation_be(sentence):

     be = ( 'be', 'been', 'is', 'was', 'are', 'were' )
     place = ('there', 'here')
     gender_identity = ('he', 'she')
     indicator =('it', 'that', 'this', 'these', 'those')
     exist =('exist')
     condition=('condition', 'status', 'quality', 'state', 'situation' 'circumstance') 
     number =('1', '2', '3', '4', '5')
     consequence=('consequence', 'result')
     to = ('to') 

     if sentence.split()[1] in be:
          if sentence.split()[0] in place:
          if sentence.split()[0] in gender_identity:
               print(sentence.replace(sentence.split()[1],'equal to'))
          if sentence.split()[0] in indicator:
               print(sentence.replace(sentence.split()[1],'equal to'))

     if sentence.split()[1] in exist:
           if sentence.split()[0] in place:

     if sentence.split()[1] in equal:
          if sentence.split()[0] in condition:
          if sentence.split()[0] in number:
          if sentence.split()[0] in consequence:

     if sentence.split()[2] in to:
           ##need to discern between preoposition to and infinitive to##

Interpretation_be('i have been to Spain')
Interpretation_be('there was a cat')
Interpretation_be('there is a woman')
Interpretation_be('he is a boy')
Interpretation_be('it is a cat')
Interpretation_be('there exist a hat')
Interpretation_be('situation equal to bad')
Interpretation_be('1 equal one')
Interpretation_be('consequence eqaul bad')

I am trying to make up English rephraser as a most basic start of natural language processing.

While building up like above code, I had wanted to get some already-classified text data which criteria of classification is word-class, such as Noun, Verb, Preposition etc.

Any good text data that I can obtain?

Please let me know.


Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.