Spaces:
Sleeping
Sleeping
Update sentence_counter.py
Browse files- sentence_counter.py +4 -4
sentence_counter.py
CHANGED
@@ -3,14 +3,14 @@ from transformers import Tool
|
|
3 |
|
4 |
class SentenceCounterTool(Tool):
|
5 |
name = "sentence_counter"
|
6 |
-
description = "This
|
7 |
inputs = ["text"]
|
8 |
outputs = ["text"]
|
9 |
|
10 |
-
def __call__(self,
|
11 |
-
print(
|
12 |
print("----")
|
13 |
-
sentences =
|
14 |
print(len(sentences))
|
15 |
return len(sentences)
|
16 |
|
|
|
3 |
|
4 |
class SentenceCounterTool(Tool):
|
5 |
name = "sentence_counter"
|
6 |
+
description = "This tool counts the sentences of a text."
|
7 |
inputs = ["text"]
|
8 |
outputs = ["text"]
|
9 |
|
10 |
+
def __call__(self, text: str):
|
11 |
+
print(text)
|
12 |
print("----")
|
13 |
+
sentences = text.split(". ")
|
14 |
print(len(sentences))
|
15 |
return len(sentences)
|
16 |
|