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

textToWordSequence in KerasTokenizer fails with UnsupportedOperationException #7073

Closed
aladjov opened this issue Jan 25, 2019 · 3 comments

Comments

Projects
None yet
3 participants
@aladjov
Copy link

commented Jan 25, 2019

Issue Description

Run-time error when processing text like this: "KINSHASA: Opposition leader Felix Tshisekedi"
The problem is triggered by the ":" because of the following two lines:
List<String> seqList = Arrays.asList(sequences);
Arrays.asList creates an unmodifiable list which contains an empty element ""
seqList.removeAll(Arrays.asList("", null));
This line tries to modify the fixed list and throws UnsupportedOperationException

Please describe our issue, along with:

  • expected behavior
    ["kinshasa", "opposition", "leader", "felix", "tshisekedi"]
  • encountered behavior
    UnsupportedOperationException

Version Information

Please indicate relevant versions, including, if relevant:

  • Deeplearning4j version
    1.0.0-BETA3
  • platform information (OS, etc)
    Ubuntu 18
  • CUDA version, if used
  • NVIDIA driver version, if in use

Contributing

Easy fix would be to initialize the seqList like this:
List<String> seqList = new ArrayList<String>(Arrays.asList(sequences));
Is there any contributing guidance or I should make Pull request directly. I did spotted some other bugs in the same module which I can try to fix and add some unit tests

@maxpumperla

This comment has been minimized.

Copy link
Contributor

commented Jan 30, 2019

@aladjov thanks for spotting this. yeah, by all means go ahead and create a pull request. Ping me once you're ready, I'm happy to help and review.

@farizrahman4u

This comment has been minimized.

Copy link
Member

commented Apr 9, 2019

Fixed #7500

@lock

This comment has been minimized.

Copy link

commented May 17, 2019

This thread has been automatically locked since there has not been any recent activity after it was closed. Please open a new issue for related bugs.

@lock lock bot locked and limited conversation to collaborators May 17, 2019

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
You can’t perform that action at this time.