Comments (3)
You need to make sure you use a Tokenizer in KeyBERT that supports tokenization of Chinese. I suggest installing jieba
for this:
from sklearn.feature_extraction.text import CountVectorizer
import jieba
def tokenize_zh(text):
words = jieba.lcut(text)
return words
vectorizer = CountVectorizer(tokenizer=tokenize_zh)
Then, simply pass the vectorizer to your KeyBERT instance:
from keybert import KeyBERT
kw_model = KeyBERT()
keywords = kw_model.extract_keywords(doc, vectorizer=vectorizer)
from keybert.
the output like the picture above
from keybert.
from keybert.
Related Issues (20)
- How can I use the KeyBERT if I have tokenized Chinese documents by myself? HOT 1
- KeyLLM seems to use OpenAI parameters that are deprecated HOT 13
- Does KeyBERT support openai ada embedding? HOT 1
- KeyBERT with llm and embedding model: endless loop during extract_keywords HOT 4
- Question about KeyLLM + KeyBERT HOT 6
- Bug: possible mistake in MMR calculation HOT 1
- Cohere default model HOT 3
- importing KeyBERT causes pydantic_core problems HOT 3
- KeyLLM fails when no GPU is available HOT 1
- extraction of keywords should be ignored when the LLM does not know or does not find them HOT 2
- Is there a batched-based keyword extraction approach with keyBERT? HOT 2
- KeyLLM error with bedrock model HOT 9
- KeyLLM parameter control HOT 3
- Langchain produces error based on instructions in sourcecode HOT 1
- Stopwords on KeyBERT HOT 6
- KeyLLM - Mistral token issue HOT 1
- Running Keybert for a list of docs to extract arabic keywords HOT 1
- KeyLLM - page_content error with bedrock model HOT 3
- Efficient KeyLLM + KeyBERT - Torch not compiled with CUDA enabled HOT 1
- Allow KeyBERT to pass `batch_size` to `llm.encode()` method HOT 5
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from keybert.