Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

MinIE Service, options to include Factuality and Attribution? #12

Open
chrisoutwright opened this issue Dec 12, 2020 · 0 comments
Open

Comments

@chrisoutwright
Copy link

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?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant