Topic
8 replies Latest Post - ‏2012-04-22T15:06:01Z by bfoyle
Mr.O
Mr.O
5 Posts
ACCEPTED ANSWER

Pinned topic Ontology and UIMA

‏2012-03-27T17:16:37Z |
hello,

I would like to know if it is possible to create a Dictionary from a Ontology (in OWL or RDF format). I would like that UIMA to be used to classify a words contained in a text by using a given ontology (Sentiment Analysis).
General: how can i use ontology with LRW?!

best regards
Updated on 2012-04-22T15:06:01Z at 2012-04-22T15:06:01Z by bfoyle
  • bfoyle
    bfoyle
    60 Posts
    ACCEPTED ANSWER

    Re: Ontology and UIMA

    ‏2012-04-04T15:20:51Z  in response to Mr.O
    There is not an easy way to do this at this time. The import into a dictionary is csv based so you would need to do some transformation at the very least.
    • Mr.O
      Mr.O
      5 Posts
      ACCEPTED ANSWER

      Re: Ontology and UIMA

      ‏2012-04-05T21:03:32Z  in response to bfoyle
      Actually i can transform a file from OWL/RDF-Format to csv-format. but the problem is i can not have a hierarchy in a UIMA-Dictionary (means the relation between the words). i don't know how can i transform the relation from the ontology and use it in UIMA-Annotator for ICA!

      Maybe there are another way to use ontoloy with UIMA or use in IBM LanguageWare...
      thanks!

      best regards
      • bfoyle
        bfoyle
        60 Posts
        ACCEPTED ANSWER

        Re: Ontology and UIMA

        ‏2012-04-06T05:12:26Z  in response to Mr.O
        can you post a small snippet of your ontology so I can get an idea of what you are playing with?
        • Mr.O
          Mr.O
          5 Posts
          ACCEPTED ANSWER

          Re: Ontology and UIMA

          ‏2012-05-23T15:02:56Z  in response to bfoyle
          sure!

          i try to solve following problem in sentiment analysis with using ontology:
          One word may have different polarities in the same domain in combination with different targets. For example word "warm", restaurant domain:
          "They gave me a warm welcome . . . " (positive)
          ". . . and warm beer." (negative)

          Also i have some hierarchy in my ontology:

          Restaurant
          |---welcome
          |--HasNegativeAdjectiv-->cold
          |--HasPositiveAdjective-->warm
          |---beer
          |--HasNegativeAdjectiv-->warm
          |--HasPositiveAdjective-->cold
          want automatically translate it into a UIMA-Annotator!
          Updated on 2012-05-23T15:02:56Z at 2012-05-23T15:02:56Z by Mr.O
          • Mr.O
            Mr.O
            5 Posts
            ACCEPTED ANSWER

            Re: Ontology and UIMA

            ‏2012-04-07T14:48:21Z  in response to Mr.O
            here attached a Graphics from my ontology!
            • bfoyle
              bfoyle
              60 Posts
              ACCEPTED ANSWER

              Re: Ontology and UIMA

              ‏2012-04-10T23:28:24Z  in response to Mr.O
              I think the way you would get this to work in a simple dictionary form is to create a csv file from your ontology that is sort of flattened out...maybe looking something like:

              
              phrase, POS, polarity warm beer, unknown, negative warm welcome, unknown, positive cold beer, unknown, positive cold welcome, unknown, negative
              


              ...and import that into a dictionary.

              Then when you run that basic annotator you get something like this attached image:

              ...and you can map the polarity to a field / facet in ICA for analysis.

              This, however, will only pick up terms in that you've specified for this in your ontology....if you have defined this for 1,000 terms, it would identify 1,000 terms correctly. Others would not be picked up.

              A different approach might be to create a parsing rule (or series of them) that look for these types of things. This is much more involved but doesn't involve explicitly describing every example in your ontology so if you end up down with road with some phrase like "good grief" ...if modeled properly, it would pick it up as a negative sentiment. Possibly more work than just defining them in an ontology? ...maybe.
              • Mr.O
                Mr.O
                5 Posts
                ACCEPTED ANSWER

                Re: Ontology and UIMA

                ‏2012-04-22T13:44:45Z  in response to bfoyle
                At first: Thanks!

                create a dictionary from ontology is a nice idea...but in your example if you have some words between 'beer' and 'cold' something like following example: "the beers are very cold" you can't annotate with this dictionary! i think adjective and phrase should be stored separately like:

                phrase, POS, adjective, polarity
                beer, unknown, warm ,negative
                welcome, unknown,warm, positive

                but i do not know how can i use this dictionary....any idea?!
                I think create a serie of parsing rules get work better...i will try to create a parsing rules-file from my ontology...
                • bfoyle
                  bfoyle
                  60 Posts
                  ACCEPTED ANSWER

                  Re: Ontology and UIMA

                  ‏2012-04-22T15:06:01Z  in response to Mr.O
                  I think you are correct...you've stated more accurately what I was trying to convey in my last paragraph. I would certainly look at parsing rules to do this sort of thing.