Skip to content

Instantly share code, notes, and snippets.

@bhoomit
Created March 23, 2017 08:17
Show Gist options
  • Select an option

  • Save bhoomit/fd4be4744473e55f3ed391abb93cd975 to your computer and use it in GitHub Desktop.

Select an option

Save bhoomit/fd4be4744473e55f3ed391abb93cd975 to your computer and use it in GitHub Desktop.
Deeps

Code

https://raw.githubusercontent.com/MajorTal/DeepSpell/8188bbea05121481273e115da6fc286b02b052f5/keras_spell.py

def test_speller():
    model = load_model("keras_spell_e349.h5")
    ctable = CharacterTable(read_top_chars())
    X_val, y_val = next(generator(NEWS_FILE_NAME_VALIDATE))
    print_random_predictions(model, ctable, X_val, y_val)

Environment

Keras V1.2.2 python 2.7

Output

Q Read TABLE 9 if you turn 65 after April 5.
A Read TABLE 9 if you turn 65 after April 5.
☒ Rnad 84ZLOoqMnnqqdmmr::kknnouhlc_t--
---
Q That seems ... odd.
A That seems ... odd.
☒ Than?mneqqdnnvmmcll_mm*!!Rbuhhl__r--
---
Q Watching the people of Egypt rise up and take Alexandria.
A Watching the people of Egypt rise up and take Alexandria.
☒ Watchinqnxxf_ttythdkkddd1//hQDDdf---
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment