question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

When using transformers model with Flair, an error occurred

See original GitHub issue

KeyBert: 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:closed
  • Created 2 years ago
  • Reactions:1
  • Comments:6 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
MaartenGrcommented, Aug 15, 2021

@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?

0reactions
MaartenGrcommented, Oct 26, 2021

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!

Read more comments on GitHub >

github_iconTop 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 >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found