Hugging Face
Models
Datasets
Spaces
Posts
Docs
Enterprise
Pricing
Log In
Sign Up
Datasets:
a686d380
/
simple-h
like
2
Dataset card
Files
Files and versions
Community
1
a686d380
commited on
Jan 24
Commit
386dc73
•
1 Parent(s):
2a64f12
Create score.py
Browse files
Files changed (1)
hide
show
score.py
+6
-0
score.py
ADDED
Viewed
@@ -0,0 +1,6 @@
1
+
def hscore(text):
2
+
cnt = 0
3
+
for i in range(len(text)):
4
+
if text[i:i+1] in keywords or text[i:i+2] in keywords:
5
+
cnt+=1
6
+
return cnt/len(text)