Code Monkey home page Code Monkey logo

stammer's Introduction

Stammer

ni zai suo sen me a?

一个 Naive 的输入法实现。人工智能导论 作业1。报告内容在 report.md 中。

编译

使用 Rust,依赖 Nightly features:

cargo +nightly build --release

之后在 target/release 下得到两个可执行文件 trainermain,即训练器和输入法。

训练

训练需要:

  • 字表,包含所有认为合法的字
  • 训练数据,格式可以是:
    • 纯文本文件
    • 提供数据中给出的新浪新闻的格式,即 LF 分割的 JSON Object,其中包含一个 html 属性,里面是训练数据

假设按照默认选项:字表位于 ./data/chars.txt,所有训练数据位于目录 ./provided/data

./target/release/trainer
# Or use cargo:
# cargo +nightly --release --bin trainer

# Other options: trainer --help

之后会生成 ./data/engine.json,是训练得到的状态文件。

执行

直接从终端输入输出:

./target/release/main
# Or: cargo run --release

包含输入输出文件:

./target/release/main -o ./data/output.txt ./data/input.txt
# Or: cargo run --release -- -o ./data/output.txt ./data/input.txt

# Other options: trainer --help

stammer's People

Contributors

circuitcoder avatar

Stargazers

 avatar

Watchers

 avatar  avatar

Forkers

connormai

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.