MCPcopy Index your code
hub / github.com/IlyaGusev/rupo

github.com/IlyaGusev/rupo @0.2.8

Chat with this repo
repository ↗ · DeepWiki ↗ · release 0.2.8 ↗ · + Follow
278 symbols 926 edges 47 files 108 documented · 39%
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Python library for analysis and generation of poems in Russian

Current version on PyPI Python versions Build Status Code Climate Documentation Status

Install

git clone https://github.com/IlyaGusev/rupo
cd rupo
pip install -r requirements.txt
sh download.sh

Usage manual

Analysis

>>> from rupo.api import Engine
>>> engine = Engine(language="ru")
>>> engine.load(<stress model path>, <zalyzniak dict path>)
>>> engine.get_stresses("корова")
[3]

>>> engine.get_word_syllables("корова")
["ко", "ро", "ва"]

>>> engine.is_rhyme("корова", "здорова")
True

>>> text = "Горит восток зарёю новой.\nУж на равнине, по холмам\nГрохочут пушки. Дым багровый\nКругами всходит к небесам."
>>> engine.classify_metre(text)
iambos

Generation

Script for poem generation. It can work in two different modes: sampling or beam search.

python generate_poem.py
Argument Default Description
--metre-schema +- feet type: -+ (iambos), +- (trochee), ...
--rhyme-pattern abab rhyme pattern
--n-syllables 8 number of syllables in line
--sampling-k 50000 top-k words to sample from (sampling mode)
--beam-width None width of beam search (beam search mode)
--temperature 1.0 sampling softmax temperature
--last-text None custom last line
--count 100 count of poems to generate
--model-path None optional path to generator model directory
--token-vocab-path None optional path to vocabulary
--stress-vocab-path None optional path to stress vocabulary

Models

  • Generator: https://www.dropbox.com/s/dwkui2xqivzsyw5/generator_model.zip
  • Stress predictor: https://www.dropbox.com/s/i9tarc8pum4e40p/stress_models_14_05_17.zip
  • G2P: https://www.dropbox.com/s/7rk135fzd3i8kfw/g2p_models.zip
  • Dictionaries: https://www.dropbox.com/s/znqlrb1xblh3amo/dict.zip

Литература

Core symbols most depended-on inside this repo

Shape

Method 212
Class 53
Function 13

Languages

Python100%

Modules by API surface

rupo/main/markup.py30 symbols
rupo/metre/pattern_analyzer.py28 symbols
rupo/metre/metre_classifier.py22 symbols
rupo/stress/word.py18 symbols
rupo/api.py16 symbols
rupo/main/tokenizer.py15 symbols
rupo/test_api.py12 symbols
rupo/stress/dict.py11 symbols
rupo/metre/test_metre_classifier.py11 symbols
rupo/main/vocabulary.py11 symbols
rupo/util/mixins.py8 symbols
rupo/stress/predictor.py8 symbols

For agents

$ claude mcp add rupo \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page