melzohbi commited on
Commit
7ce8729
·
verified ·
1 Parent(s): 5f7d7d2

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +56 -3
README.md CHANGED
@@ -1,3 +1,56 @@
1
- ---
2
- license: mit
3
- ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ ---
2
+ license: mit
3
+ pipeline_tag: text-generation
4
+ language:
5
+ - en
6
+ ---
7
+
8
+ # Let the Poem Hit the Rhythm: Using a Byte-Based Transformer for Beat-Aligned Poetry Generation
9
+
10
+
11
+ ## Model Summary
12
+
13
+ This repository contains an implementation of a beat-aligned poetry filler model using the ByT5 transformer.
14
+
15
+ This model allows users to insert a beat pattern into a poem or song lyric and generates candidates that align with the specified beat pattern while preserving the contextual meaning.
16
+
17
+ Think of this model as a tool for songwriting or poetry composition where you have gaps in your lines. Instead of leaving those gaps blank, you fill them with sounds mimicking the flow of words, similar to scat singing. For example: The "da-dam" is whispering something to me! Possible words that fit the flow could be: "heaven," "woman," or "city." This model assists in finding words that maintain the rhythmic flow.
18
+
19
+
20
+ ## Encoding
21
+
22
+ A “1” represents a beat unit where there is a vowel onset, and a “0” represents a non-beat unit (or rest) where you have a consonant not followed by a vowel or a vowel not preceded by a consonant.
23
+
24
+ - `da-`: 1
25
+ - `-m`: 0
26
+ - `dam`: 10
27
+ - `da-da-dam-dam-da-dam`: 111010110
28
+
29
+
30
+ ## Using Text2Text Pipeline
31
+
32
+ To get started with the model, use the following code. Note that the beat pattern should be enclosed between `<extra_id_0>` and `<extra_id_1>`.
33
+
34
+ ```python
35
+ from transformers import pipeline
36
+
37
+ beat_aligned_generator = pipeline("text2text-generation", model='melzohbi/byt5-beat-align-base')
38
+ poem = "The <extra_id_0>110<extra_id_1> is whispering something to me. <extra_id_2>"
39
+ generated_words = beat_aligned_generator(poem, max_length=30, do_sample=True, num_return_sequences=5, temperature=0.8, top_p=1)
40
+ print(generated_words)
41
+
42
+ ```
43
+
44
+
45
+ ## Citation
46
+
47
+ If you use this model in your research, please cite the following paper:
48
+
49
+ ```
50
+ @inproceedings{elzohbi2024let,
51
+ title={Let the Poem Hit the Rhythm: Using a Byte-Based Transformer for Beat-Aligned Poetry Generation},
52
+ author={Elzohbi, Mohamad and Zhao, Richard},
53
+ booktitle={Proceedings of the 15th International Conference on Computational Creativity (ICCC)},
54
+ year={2024}
55
+ }
56
+ ```