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

ML-based suggestions ordering (AGPL dependency removed) #1115

Merged

Conversation

oserikov
Copy link
Contributor

Fixed #1020
AGPL dependency removed

oserikov and others added 5 commits July 25, 2018 00:09
…tool into spelling-corrections-ordering

# Conflicts:
#	languagetool-core/pom.xml
#	languagetool-core/src/main/java/org/languagetool/rules/spelling/morfologik/suggestions_ordering/SuggestionsOrderer.java
#	languagetool-core/src/main/java/org/languagetool/rules/spelling/morfologik/suggestions_ordering/SuggestionsOrdererConfig.java
#	languagetool-core/src/test/java/org/languagetool/rules/spelling/morfologik/suggestions_ordering/SuggestionsOrdererTest.java
#	languagetool-server/src/main/java/org/languagetool/server/HTTPServerConfig.java
@oserikov
Copy link
Contributor Author

Now using the https://github.com/komiya-atsushi/xgboost-predictor-java lib, it is licensed under the Apache 2.0. Is it Ok?

@danielnaber
Copy link
Member

Thanks, the Apache 2.0 license is fine.

@yakovru
Copy link
Member

yakovru commented Jul 26, 2018

I will merge this pull request today.

@yakovru yakovru merged commit ebc14ca into languagetool-org:master Jul 26, 2018
@@ -189,6 +196,23 @@
<scope>test</scope>
</dependency>

<!--xgboost-related pmml dependencies-->
<!--<dependency>-->
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Can be removed, or is there a reason to only comment them out?

@@ -0,0 +1,18 @@
package org.languagetool.languagemodel;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please add a license header here (and all the other new files)


private boolean MLAvailable = true;

private static SuggestionsOrderer.NGramUtil nGramUtil = null;
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Do these have to be static?

int startPos = sentence.indexOf(word);
int wordLength = word.length();
List<String> suggestionsOrdered = suggestionsOrderer.orderSuggestionsUsingModel(suggestions, word, languageTool.getAnalyzedSentence(sentence), startPos, wordLength);
assertTrue(suggestionsOrdered.containsAll(suggestions));
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Shouldn't this assert check the order instead of just whether the items exist, or am I missing something?

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

Successfully merging this pull request may close these issues.

None yet

4 participants