When using transformers model with Flair, an error occurred
See original GitHub issueKeyBert: K0.3.0 Flair: V0.8.0
from keybert import KeyBERT from flair.embeddings import TransformerDocumentEmbeddings doc = """ ****** """ roberta= TransformerDocumentEmbeddings('roberta-base') model = KeyBERT(model=roberta) keywords = model.extract_keywords(doc, keyphrase_ngram_range=(2, 2), stop_words='english', use_mmr=True, diversity=0.7) print(keywords)
TypeError: stat: path should be string, bytes, os.PathLike or integer, not TransformerDocumentEmbeddings
Issue Analytics
- State:
- Created 2 years ago
- Reactions:1
- Comments:6 (4 by maintainers)
Top Results From Across the Web
Flair en-sentiment model loading fails when not connected to ...
The following code fails for me when I do not have a working internet connection, with the error message that I have detailed...
Read more >Troubleshoot - Hugging Face
Sometimes errors occur, but we are here to help! This guide covers some of the most common issues we've seen and how you...
Read more >flair · PyPI
A very simple framework for state-of-the-art NLP. Developed by Humboldt University of Berlin and friends. Flair is: A powerful NLP library.
Read more >Flair - The Software Engineering Research Group
It is built directly on PyTorch which allows for ease of use in training and experimenting with models. Stakeholders. Stakeholders in a software...
Read more >FAQ - BERTopic
BERTopic allows you to use any transformers model. ... created on a word/sentence level but can easily be pooled using Flair (see Guides/Embeddings)....
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

@KamyarGhajar Have you tried out the suggestion above (installing KeyBERT in a fresh environment with
pip install keybert[flair])? Also, could you share how you installing KeyBERT and which versions of packages you have in your environment?Since this issue has been a while without activity, I’ll be closing it for now. However, if you are still experiencing the issue or want to discuss it further, let me know!