Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
B
BabelZoo
Overview
Overview
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
PLN
BabelZoo
Commits
29a23ae7
Unverified
Commit
29a23ae7
authored
Nov 23, 2019
by
PLN (Algolia)
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
feat(Kawa): tonekize "
parent
170dc893
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
20 additions
and
1 deletion
+20
-1
lyrics.py
KoozDawa/dawa/lyrics.py
+17
-0
tokens.py
KoozDawa/dawa/tokens.py
+3
-1
No files found.
KoozDawa/dawa/lyrics.py
View file @
29a23ae7
import
lyricsgenius
def
fetch
():
genius
=
lyricsgenius
.
Genius
(
"zUSpjfQ9ELXDqOjx9hGfAlJGYQFrNvHh3rlDV298_QSr5ScKf3qlHZtOO2KsXspQ"
)
response
=
genius
.
search_artist
(
"Dooz-kawa"
)
for
hit
in
response
[
"hits"
]:
print
(
hit
)
def
main
():
fetch
()
if
__name__
==
'__main__'
:
main
()
KoozDawa/dawa/tokens.py
View file @
29a23ae7
...
...
@@ -5,7 +5,9 @@ from KoozDawa.dawa.loader import load_kawa
class
PoemTokenizer
(
Tokenizer
):
def
__init__
(
self
,
**
kwargs
)
->
None
:
super
()
.
__init__
(
lower
=
False
,
filters
=
'"#$
%
&()*+,-/<=>@[
\\
]^_`{|}~
\t\n
'
,
oov_token
=
"😢"
,
**
kwargs
)
super
()
.
__init__
(
lower
=
True
,
# TODO: Better generalization without?
filters
=
'#$
%
&()*+/<=>@[
\\
]^_`{|}~
\t\n
'
,
oov_token
=
"😢"
,
**
kwargs
)
def
get_sequence_of_tokens
(
self
,
corpus
):
self
.
fit_on_texts
(
corpus
)
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment