https://github.com/hpprc/ujimaru
🤖 The automatic uzimaru bot project🤖
https://github.com/hpprc/ujimaru
go markov-chain python rust
Last synced: 3 months ago
JSON representation
🤖 The automatic uzimaru bot project🤖
- Host: GitHub
- URL: https://github.com/hpprc/ujimaru
- Owner: hppRC
- Created: 2020-05-25T03:29:37.000Z (about 5 years ago)
- Default Branch: master
- Last Pushed: 2021-06-06T21:16:14.000Z (about 4 years ago)
- Last Synced: 2024-10-09T23:07:28.287Z (9 months ago)
- Topics: go, markov-chain, python, rust
- Language: Python
- Homepage: https://twitter.com/ujimaru0000
- Size: 123 KB
- Stars: 11
- Watchers: 4
- Forks: 0
- Open Issues: 11
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Ujimaru (Happy Birthday uzimaru0000)
This project is a twitter bot like [@uzimaru0000](https://twitter.com/uzimaru0000)
projects:
- Twitter Client (Rust, Kuon)
- Twitter Crawler (Go, anaconda)
- Ujimaru API (Python, flask)
- Ujimaru Markov Experiment(Python, NLP)
- Ujimaru Markov Model (Python, NLP)
- Ujimaru Reformer (Python, NLP)## Twitter Client
Twitter client implementations for [@ujimaru0000](https://twitter.com/ujimaru0000)
Written in Rust. (Using [Kuon](https://github.com/hppRC/kuon))
### TL;DR
Just below.
```rust
let api: kuon::TwitterAPI = get_api_client().await?;let endpoint = &std::env::var("UJIMARU_API")?;
let text = reqwest::get(endpoint).await?.text().await?;api.tweet(&text).await?;
```## Twitter Crawler
Twitter crawler to collect tweets of Uzimaru and other users.
Written in Go. (Using [anaconda](https://github.com/ChimeraCoder/anaconda))
## Ujimaru API
Text generation API for ujimaru.
Written in Python. (Using [markovify](https://github.com/jsvine/markovify) and [ujimaru-markov-model](https://pypi.org/project/ujimaru-markov-model/))
This is a flask application, and deployed on the Cloud Run.
## Ujimaru Markov Experiment
Implementations and experiments.
- build Markov models
- dump models as JSON
- cleansing texts
- library usage tests## Ujimaru Markov Model
An easy ujimaru(uzimaru0000 like) text generator library.
PyPI: [ujimaru-markov-model](https://pypi.org/project/ujimaru-markov-model/)
This library generates text using a third-order Markov chain.
```
pip install ujimaru-markov-model
```### Usage
```
# On CLI
ujimaru
# へーー自然を撮るならいいってことか(それはそうなんだけど普通のRTになってるって!
```or
```python
# In a Python program
# load model (model included).
from ujimaru_markov_model import Ujimaru
ujimaru = Ujimaru()print(ujimaru.make_sentence())
# なんでかElmでCLI作って得られた知見をいくつかqiitaとかにいれておいてcpすることにします!!
print(ujimaru.make_tweet()) # A sentence of 140 characters or less
# 検索しても無限にredux-thunkが出てきて「なっっっっつ」ってなったけど0.1.0のtagを打ったらちゃんとブランチ分けます
```## Ujimaru Reformer
A text generation program by [reformer](https://github.com/google/trax/tree/master/trax/models/reformer) and [sentencepiece](https://github.com/google/sentencepiece).
see below
- [https://ai-scholar.tech/articles/treatise/reformer-ai-364](https://ai-scholar.tech/articles/treatise/reformer-ai-364)
- [Reformer: The Efficient Transformer](https://arxiv.org/abs/2001.04451)### Caution
This program will use your computer resources extremely.
You should use Google Colaboratory to run this model.