Spaces:
Configuration error
Configuration error
Upload tool
Browse files
tool.py
CHANGED
@@ -1,7 +1,7 @@
|
|
1 |
from smolagents.tools import Tool
|
2 |
import json
|
3 |
-
import pronouncing
|
4 |
import string
|
|
|
5 |
|
6 |
class ParodyWordSuggestionTool(Tool):
|
7 |
name = "parody_word_suggester"
|
@@ -9,7 +9,7 @@ class ParodyWordSuggestionTool(Tool):
|
|
9 |
Returns similar-sounding words that rhyme, especially focusing on common vowel sounds."""
|
10 |
inputs = {'target': {'type': 'string', 'description': 'The word you want to find rhyming alternatives for'}, 'word_list_str': {'type': 'string', 'description': 'JSON string of word list (e.g. \'["word1", "word2"]\')'}, 'min_similarity': {'type': 'string', 'description': 'Minimum similarity threshold (0.0-1.0)', 'nullable': True}, 'custom_phones': {'type': 'object', 'description': 'Optional dictionary of custom word pronunciations', 'nullable': True}}
|
11 |
output_type = "string"
|
12 |
-
VOWEL_REF = "AH,
|
13 |
|
14 |
def _get_vowel_groups(self):
|
15 |
groups = []
|
|
|
1 |
from smolagents.tools import Tool
|
2 |
import json
|
|
|
3 |
import string
|
4 |
+
import pronouncing
|
5 |
|
6 |
class ParodyWordSuggestionTool(Tool):
|
7 |
name = "parody_word_suggester"
|
|
|
9 |
Returns similar-sounding words that rhyme, especially focusing on common vowel sounds."""
|
10 |
inputs = {'target': {'type': 'string', 'description': 'The word you want to find rhyming alternatives for'}, 'word_list_str': {'type': 'string', 'description': 'JSON string of word list (e.g. \'["word1", "word2"]\')'}, 'min_similarity': {'type': 'string', 'description': 'Minimum similarity threshold (0.0-1.0)', 'nullable': True}, 'custom_phones': {'type': 'object', 'description': 'Optional dictionary of custom word pronunciations', 'nullable': True}}
|
11 |
output_type = "string"
|
12 |
+
VOWEL_REF = "AH,AX|UH|AE,EH|IY,IH|AO,AA|UW|AY,EY|OW,AO|AW,AO|OY,OW|ER,AXR"
|
13 |
|
14 |
def _get_vowel_groups(self):
|
15 |
groups = []
|