MaartenGr / MaartenGr/KeyBERT

output arrangement

Open
#138 1 comment 0 reactions 0 assignees View on GitHub
Dominant language
Python
Stars
4.2k
Forks
385
PR merge metrics
No merged PRs in 30d

Description

I am getting results arranged according to the importance

```
def keyword_exctraction(self,new_text):
eng_stopwords = stopwords.words('english')
hinglish_stopwords=pd.read_csv("stopwords_hinglish.csv")
hinglish_stop_words=hinglish_stopwords['Stop_words'].tolist()
stop=hinglish_stop_words+eng_stopwords
multilingual = SentenceTransformer('sentence-transformers/paraphrase-MiniLM-L6-v2')
kw_model = KeyBERT(model=multilingual)
doc = new_text
keyword = kw_model.extract_keywords(doc, stop_words=stop,top_n=10,
use_mmr=False,diversity=0.2,highlight=False)
multilingual = SentenceTransformer('sentence-transformers/paraphrase-MiniLM-L6-v2')
kw_model = KeyBERT(model=multilingual)
#print(keyword)
return keyword
```
`keyword_extracted=self.keyword_exctraction(text)`

`text = "i want Iphone 14 purple"`

The results i am getting is :
[('iphone', 0.5916), ('purple', 0.5219), ('14', 0.272)]

But the language order of the result should be "iphone 14 purple"
How can we get results in order via keybert?

Contributor guide

No contributing guide indexed for this repository

Research direction

Start with the keyword_exctraction method and the KeyBERT extract_keywords call shown in the issue, including its ordering-related arguments. Check how returned keywords are ordered and whether the requested input order can be supported; done means the example returns the keywords in the order “iphone 14 purple.”

Written by the indexing model from the issue text.

Assessment

Tech stack
python
Domain
machine-learning
Issue type
Feature
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.