Code Monkey home page Code Monkey logo

Comments (4)

behitek avatar behitek commented on August 15, 2024 1

Here is my code:

def underthesea_tokenize(txt):
    return word_tokenize(txt, format="text")
...
// Call underthesea_tokenize func for each line of text read from file
line = underthesea_tokenize(line)
...

Do you have any solution to catch this issue?

from underthesea.

rain1024 avatar rain1024 commented on August 15, 2024 1

This error caused by incorrect url pattern in regex_tokenize module. It's already fixed.

You can retest by update latest version of underthesea

$ pip uninstall underthesea
$ pip install underthesea==1.1.8a0
$ python
>>> from underthesea import word_tokenize
>>> text = "https://www.facebook.com/photo.php?fbid=1627680357512432&set=a.1406713109609159.1073741826.100008114498358&type=1 mình muốn chia sẻ bài viết của một bác nói về thực trạng của bộ giáo dục bây giờ! mọi người vào đọc và chia sẻ để Phạm Vũ Luận BIẾT!"
>>> word_tokenize(text)
['https://www.facebook.com/photo.php?fbid=1627680357512432&set=a.1406713109609159.1073741826.100008114498358&type=1', 'mình', 'muốn', 'chia sẻ', 'bài', 'viết', 'của', 'một', 'bác', 'nói', 'về', 'thực trạng', 'của', 'bộ', 'giáo dục', 'bây giờ', '!', 'mọi', 'người', 'vào', 'đọc', 'và', 'chia sẻ', 'để', 'Phạm', 'Vũ', 'Luận', 'BIẾT', '!']

Close this issue here! Feel free to open it if you find this error is not fixed.

from underthesea.

rain1024 avatar rain1024 commented on August 15, 2024

@Hieunv1996 what is your code?

I think this error caused by some special characters in the text

from underthesea.

rain1024 avatar rain1024 commented on August 15, 2024

@Hieunv1996

Okay. I can reproduce this error with the following code

from underthesea import word_tokenize
text = "https://www.facebook.com/photo.php?fbid=1627680357512432&set=a.1406713109609159.1073741826.100008114498358&type=1 mình muốn chia sẻ bài viết của một bác nói về thực trạng của bộ giáo dục bây giờ! mọi người vào đọc và chia sẻ để Phạm Vũ Luận BIẾT!"
word_tokenize(text)

There are dot characters in url, which is so weird. I will debug and fix it soon.

Thanks for your reporting.

from underthesea.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.