minie icon indicating copy to clipboard operation
minie copied to clipboard

MinIE Service, options to include Factuality and Attribution?

Open chrisoutwright opened this issue 3 years ago • 0 comments

I cannot contact Pasquale Minervini directly (nor append the question to his fork), therefore: Is it correct, that one has to change public class FactsResource to account for Factuality and Attribution?

I modified the class in this way:

    public FactsBean query(String sentence) {
        MinIE minie = new MinIE(sentence, FactsResource.parser, MinIE.Mode.AGGRESSIVE);

        List<Fact> facts = new ArrayList<>();

        
        
        
        //System.out.println("Extractions:");
        for (AnnotatedProposition ap: minie.getPropositions()) {
        	
        	String att = "None";

            List<AnnotatedPhrase> triple = ap.getTriple();
            
            String s = triple.get(0).toString();
            String p = triple.get(1).toString();
            String o = triple.get(2).toString();
            

			
			String f = ap.getFactualityAsString();
			  
			if (ap.getAttribution().getAttributionPhrase() != null) { 
				att = ap.getAttribution().toStringCompact(); }
			 

            Fact fact = new Fact(s, p, o, att, f);
            facts.add(fact); }

I have also set getter and setter methods in line with the new constructor public Fact(String s, String p, String o, String at, String f).

The service is not working correctly all the time. Although the non-service (Demo.java) would yield empty sets for these instances, the service would return:

    <body>
        <div class="header">Request failed.</div>
        <div class="body">Request failed.</div>
        <div class="footer">Grizzly 2.4.0</div>
    </body>

Without stating the reasons for the behavoir. Also the Logger.getLogger() output won't yield anything useful on the cmd where the service was started.

What would be the correct way to have the service yield the Factuality and Attribution without giving failed requests?

chrisoutwright avatar Dec 12 '20 01:12 chrisoutwright