xuanchien / ilp_astractive_summarization

Summarization system following abstraction-based approach using integer linear programming and deep learning
9 stars 3 forks source link

Regarding package intoxicant.analytics.coreNlp #1

Open carljameson2 opened 7 years ago

carljameson2 commented 7 years ago

I am trying to make some improvements in your project but the StopwordAnnotator.java has some errors. I tried to incorporate all the jar files related to apache lucene analyzer but the issue in the words 'Requirement' , ''English_stop_words_set' , 'Stanford_stopword' show errors. Also what jar file is required for 'edu.stanford.nlp.hcoref.data.CorefChain' Can you help me with that?

xuanchien commented 7 years ago

I use Stanford CoreNLP 3.6.0 and Java 1.8. Make sure these are what you include in your project.

carljameson2 commented 7 years ago

if (this.props.containsKey(STOPWORDS_LIST)) { String stopwordList = props.getProperty(STOPWORDS_LIST); boolean ignoreCase = Boolean.parseBoolean(props.getProperty(IGNORE_STOPWORD_CASE, "false")); this.stopwords = getStopWordList(stopwordList, ignoreCase); } else { this.stopwords = (Set)StopAnalyzer.ENGLISH_STOP_WORDS_SET; //this line has error } }

@Override public Set requires() { if (checkLemma) { return TOKENIZE_SSPLIT_POS_LEMMA; //this line has error } else { return TOKENIZE_AND_SSPLIT; //this line has error } }

for (Integer key: selectedNP.keySet()){ Phrase nounPhrase = selectedNouns.get(key); List phrases = selectedNP.get(key); String sentence = nounPhrase.getContent() + " "; Integer minID = Integer.MAX_VALUE;

        List<String> verbs = new ArrayList<>();

Collections.sort(phrases, (a, b) -> a.getId().compareTo(b.getId())); //this line shows error

carljameson2 commented 7 years ago

those 3 snippets are different parts of the code. First two are part of stopwordannotator.java and third is from parser.java

xuanchien commented 7 years ago

Can you post the error log here?

carljameson2 commented 7 years ago

Exception in thread "main" java.lang.ArrayIndexOutOfBoundsException: 0 at edu.stanford.nlp.parser.lexparser.EnglishTreebankParserParams.main(EnglishTreebankParserParams.java:2372)

carljameson2 commented 7 years ago

Line no 441 in Parser.java shows me an error only which says 'a' cannot be resolved.

carljameson2 commented 7 years ago

sorry, It was both a and b cannot be resolved into variables.

xuanchien commented 7 years ago

The error with line 441 in Parser.java is mostly because you are setting the language level of your project lower than 1.8. What IDE are you using? Try to change the language level to see if this issue is resolved. Lambda expression is only available in Java 1.8, I believe.

carljameson2 commented 7 years ago

I'm working on Eclipse.

carljameson2 commented 7 years ago

Error doesn't go even when I use 1.8