Hugging Face
Models
Datasets
Spaces
Buckets
new
Docs
Enterprise
Pricing
Website
Tasks
HuggingChat
Collections
Languages
Organizations
Community
Blog
Posts
Daily Papers
Hardware
Learn
Discord
Forum
GitHub
Solutions
Team & Enterprise
Hugging Face PRO
Enterprise Support
Inference Providers
Inference Endpoints
Storage Buckets
Log In
Sign Up
Spaces:
ml6team
/
Knowledge-graphs
like
55
Build error
App
Files
Files
Community
1
Fetching metadata from the HF Docker repository...
refs/pr/1
Knowledge-graphs
/
utils.py
khaerens
updated to singletons
b40f434
about 3 years ago
Raw
Download with hf CLI
Copy download link
History
Blame
Safe
218 Bytes
def
clip_text
(
t, lenght =
4
):
t_sub = t.replace(
"..."
,
"dotdotdot"
)
t_clipped =
"."
.join(t_sub.split(
"."
)[:lenght]) +
"."
t_reverted = t_clipped.replace(
"dotdotdot"
,
"..."
)
return
t_reverted