jsvine / jsvine/markovify

Fallback without building a new model?

Open
#168 1 comment 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

Dominant language
Python
Stars
3.4k
Forks
348
PR merge metrics
No merged PRs in 30d

Description

I'm trying to build a Slack chatbot using bits and pieces of code I've found lying around on the internet. One of them included markovify and it's just about the only thing from it that worked! I was wondering, though, if there's a way to fall back to a smaller state_size without building an entire fallback model. What I've done in the interim is create 2- and 1-word models. If the 2-word init_state key isn't in the model, it tries the 1-word model with the first word of the key. Failing that, it just lets it come up with something without the init_state argument. I'm sure that as my corpus gets larger, this is going to become unwieldy. I hope this is possible without making any changes to the codebase, but hope you'll consider it, either way.

Thanks for writing this!

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start by reading how markovify handles state_size and init_state, then reproduce the missing-key fallback described in the issue with a corpus. Done means a smaller state_size can be used without constructing separate 2-word and 1-word models, with the behavior covered by an appropriate test.

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
4/5
Estimated time
3-5 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
30/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.