Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 1.8.1
    • Component/s: None
    • Labels:

      Description

      Many of the components in OpenNLP are sensitive to the input language. It would be nice if OpenNLP would have a component to detect the language of an input text.

      Two commonly used solutions today are:
      Apache Tikas Language Identifier
      Language Detection from Shuyo, Nakatani

        Issue Links

          Activity

          Hide
          teofili Tommaso Teofili added a comment -

          good point, that would be a very valuable contribution.
          I was just having a look at how Apache Solr handles that and it turns out it's exactly those 2 solutions.

          Show
          teofili Tommaso Teofili added a comment - good point, that would be a very valuable contribution. I was just having a look at how Apache Solr handles that and it turns out it's exactly those 2 solutions.
          Hide
          joern Joern Kottmann added a comment -

          Maybe the following interface would be suitable:
          public interface LanguageDetector

          { Language[] detectLanguage(CharSequence content); Set<String> getSupportedLanguages(); String getLanguageCoding(); }

          The doccat component can already do language detection with a custom factory. Maybe we can find a way to build a language detector based on the doccat work. This would avoid quite some code duplication.

          Show
          joern Joern Kottmann added a comment - Maybe the following interface would be suitable: public interface LanguageDetector { Language[] detectLanguage(CharSequence content); Set<String> getSupportedLanguages(); String getLanguageCoding(); } The doccat component can already do language detection with a custom factory. Maybe we can find a way to build a language detector based on the doccat work. This would avoid quite some code duplication.
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user wcolen opened a pull request:

          https://github.com/apache/opennlp/pull/143

          OPENNLP-788: [WIP] Add initial langdetect implementation

          Thank you for contributing to Apache OpenNLP.

          In order to streamline the review of the contribution we ask you
          to ensure the following steps have been taken:

              1. For all changes:
          • [X] Is there a JIRA ticket associated with this PR? Is it referenced
            in the commit message?
          • [X] Does your PR title start with OPENNLP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
          • [X] Has your PR been rebased against the latest commit within the target branch (typically master)?
          • [ ] Is your initial contribution a single, squashed commit?
              1. For code changes:
          • [X] Have you ensured that the full suite of tests is executed via mvn clean install at the root opennlp folder?
          • [X] Have you written or updated unit tests to verify your changes?
          • [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
          • [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file in opennlp folder?
          • [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found in opennlp folder?
              1. For documentation related changes:
          • [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
              1. Note:
                Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/wcolen/opennlp OPENNLP-788a

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/opennlp/pull/143.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #143


          commit 5fdaf653cc2a790c2a5007711b1abacebda9ba56
          Author: William D C M SILVA <colen@apache.org>
          Date: 2017-03-13T16:48:33Z

          OPENNLP-788: Add LanguageDetector infrastructure classes


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user wcolen opened a pull request: https://github.com/apache/opennlp/pull/143 OPENNLP-788 : [WIP] Add initial langdetect implementation Thank you for contributing to Apache OpenNLP. In order to streamline the review of the contribution we ask you to ensure the following steps have been taken: For all changes: [X] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? [X] Does your PR title start with OPENNLP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. [X] Has your PR been rebased against the latest commit within the target branch (typically master)? [ ] Is your initial contribution a single, squashed commit? For code changes: [X] Have you ensured that the full suite of tests is executed via mvn clean install at the root opennlp folder? [X] Have you written or updated unit tests to verify your changes? [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0] ( http://www.apache.org/legal/resolved.html#category-a)? [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file in opennlp folder? [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found in opennlp folder? For documentation related changes: [ ] Have you ensured that format looks appropriate for the output in which it is rendered? Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. You can merge this pull request into a Git repository by running: $ git pull https://github.com/wcolen/opennlp OPENNLP-788 a Alternatively you can review and apply these changes as the patch at: https://github.com/apache/opennlp/pull/143.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #143 commit 5fdaf653cc2a790c2a5007711b1abacebda9ba56 Author: William D C M SILVA <colen@apache.org> Date: 2017-03-13T16:48:33Z OPENNLP-788 : Add LanguageDetector infrastructure classes
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user wcolen closed the pull request at:

          https://github.com/apache/opennlp/pull/143

          Show
          githubbot ASF GitHub Bot added a comment - Github user wcolen closed the pull request at: https://github.com/apache/opennlp/pull/143
          Hide
          githubbot ASF GitHub Bot added a comment -

          GitHub user wcolen opened a pull request:

          https://github.com/apache/opennlp/pull/230

          OPENNLP-788: Add LanguageDetector tool

          Thank you for contributing to Apache OpenNLP.

          In order to streamline the review of the contribution we ask you
          to ensure the following steps have been taken:

              1. For all changes:
          • [X] Is there a JIRA ticket associated with this PR? Is it referenced
            in the commit message?
          • [X] Does your PR title start with OPENNLP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character.
          • [X] Has your PR been rebased against the latest commit within the target branch (typically master)?
          • [X] Is your initial contribution a single, squashed commit?
              1. For code changes:
          • [X] Have you ensured that the full suite of tests is executed via mvn clean install at the root opennlp folder?
          • [X] Have you written or updated unit tests to verify your changes?
          • [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0](http://www.apache.org/legal/resolved.html#category-a)?
          • [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file in opennlp folder?
          • [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found in opennlp folder?
              1. For documentation related changes:
          • [ ] Have you ensured that format looks appropriate for the output in which it is rendered?
              1. Note:
                Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible.

          You can merge this pull request into a Git repository by running:

          $ git pull https://github.com/apache/opennlp LangDetect

          Alternatively you can review and apply these changes as the patch at:

          https://github.com/apache/opennlp/pull/230.patch

          To close this pull request, make a commit to your master/trunk branch
          with (at least) the following in the commit message:

          This closes #230


          commit 6b689681c12c162c688081cf3e358e9e082b08d7
          Author: William D C M SILVA <colen@apache.org>
          Date: 2017-05-17T16:34:21Z

          OPENNLP-788: Add LanguageDetector tool


          Show
          githubbot ASF GitHub Bot added a comment - GitHub user wcolen opened a pull request: https://github.com/apache/opennlp/pull/230 OPENNLP-788 : Add LanguageDetector tool Thank you for contributing to Apache OpenNLP. In order to streamline the review of the contribution we ask you to ensure the following steps have been taken: For all changes: [X] Is there a JIRA ticket associated with this PR? Is it referenced in the commit message? [X] Does your PR title start with OPENNLP-XXXX where XXXX is the JIRA number you are trying to resolve? Pay particular attention to the hyphen "-" character. [X] Has your PR been rebased against the latest commit within the target branch (typically master)? [X] Is your initial contribution a single, squashed commit? For code changes: [X] Have you ensured that the full suite of tests is executed via mvn clean install at the root opennlp folder? [X] Have you written or updated unit tests to verify your changes? [ ] If adding new dependencies to the code, are these dependencies licensed in a way that is compatible for inclusion under [ASF 2.0] ( http://www.apache.org/legal/resolved.html#category-a)? [ ] If applicable, have you updated the LICENSE file, including the main LICENSE file in opennlp folder? [ ] If applicable, have you updated the NOTICE file, including the main NOTICE file found in opennlp folder? For documentation related changes: [ ] Have you ensured that format looks appropriate for the output in which it is rendered? Note: Please ensure that once the PR is submitted, you check travis-ci for build issues and submit an update to your PR as soon as possible. You can merge this pull request into a Git repository by running: $ git pull https://github.com/apache/opennlp LangDetect Alternatively you can review and apply these changes as the patch at: https://github.com/apache/opennlp/pull/230.patch To close this pull request, make a commit to your master/trunk branch with (at least) the following in the commit message: This closes #230 commit 6b689681c12c162c688081cf3e358e9e082b08d7 Author: William D C M SILVA <colen@apache.org> Date: 2017-05-17T16:34:21Z OPENNLP-788 : Add LanguageDetector tool
          Hide
          githubbot ASF GitHub Bot added a comment -

          Github user asfgit closed the pull request at:

          https://github.com/apache/opennlp/pull/230

          Show
          githubbot ASF GitHub Bot added a comment - Github user asfgit closed the pull request at: https://github.com/apache/opennlp/pull/230

            People

            • Assignee:
              colen William Colen
              Reporter:
              joern Joern Kottmann
            • Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Development