Code Monkey home page Code Monkey logo

Comments (3)

tomaarsen avatar tomaarsen commented on July 1, 2024

Hello!

Since cf14dda I indeed split up punctuation from other tokens. The goal here was to make e.g. hello, into two tokens, rather than just one, so the bot learns how to extend from hello. Similarly, from I've it learns I followed by 've, so that it can extend I.

The issue you're seeing here is that it actually does not know how to extend ["I", "'ve"], because of a bug that converted I've into I 've when generating, but kept the word as I've when learning. I've fixed that now.

However, another small issue still exists: My "detokenizer", i.e. the function to turn ca n't back into can't, isn't always perfect:

>>> TreebankWordDetokenizer().tokenize(["Do", "n't"])
"Do n't"
>>> TreebankWordDetokenizer().tokenize(["Do", "n't", "want"])
"Don't want"
>>> TreebankWordDetokenizer().tokenize(["I", "'ve"])  
"I 've"
>>> TreebankWordDetokenizer().tokenize(["I", "'ve", "seen"])
"I've seen"

Using NLTK's TreebankWordDetokenizer. I can't really explain this at the moment, but it requires a fix from NLTK.


Thanks for reporting this!

  • Tom Aarsen

from twitchmarkovchain.

tomaarsen avatar tomaarsen commented on July 1, 2024

This should be fixed now in the latest release. Feel free to upgrade. Your old database won't immediately update, but new entries should be correct now.

from twitchmarkovchain.

tomaarsen avatar tomaarsen commented on July 1, 2024

I've opened up an issue on NLTK for the tokenizing issue I mentioned: nltk/nltk#3069.

from twitchmarkovchain.

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.