Chris4K commited on
Commit
ef73330
1 Parent(s): aaf767f

Rename word_counter.py to sentence_counter.py

Browse files
word_counter.py → sentence_counter.py RENAMED
@@ -1,13 +1,13 @@
1
  from transformers import AutoTokenizer
2
  from transformers import Tool
3
 
4
- class WordCounterTool(Tool):
5
- name = "word_counter"
6
- description = "This is a tool for counting word of an input."
7
  inputs = ["text"]
8
  outputs = ["text"]
9
 
10
  def __call__(self, prompt: str):
11
- words = str.split(" ")
12
- return len(words)
13
 
 
1
  from transformers import AutoTokenizer
2
  from transformers import Tool
3
 
4
+ class SentenceCounterTool(Tool):
5
+ name = "sentence_counter"
6
+ description = "This is a tool for counting sentences of an input."
7
  inputs = ["text"]
8
  outputs = ["text"]
9
 
10
  def __call__(self, prompt: str):
11
+ sentences = str.split(". ")
12
+ return len(sentences)
13