You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am trying to extract keywords from sentences using the all-MiniLM-L6-v2 model
When using this specific sentence (either alone or in combination with other sentences), the keyword extraction fails: Up 3 Up 4 Down 2 Up 7 Up 2 Down 4 Down 4 Up 6 Up 1 Down 1 Down 3
I know this may not be a meaningful sentence, but it should not cause all sentences to not be evaluated
Is there a way to fix this, or to know which sentences would fail during evaluation?
It contains this code snippet for evaluating the sentence:
let input_strings = ["Up 3 Up 4 Down 2 Up 7 Up 2 Down 4 Down 4 Up 6 Up 1 Down 1 Down 3"].to_vec();let keyword_extraction_config = KeywordExtractionConfig{sentence_embeddings_config:SentenceEmbeddingsConfig::from(SentenceEmbeddingsModelType::AllMiniLmL6V2),max_sum_candidates:Some(20),diversity:Some(0.3),scorer_type:KeywordScorerType::MaximalMarginRelevance,ngram_range:(1,1),num_keywords:6,
..Default::default()};use rust_bert::pipelines::keywords_extraction::KeywordExtractionModel;let keyword_extraction_model = KeywordExtractionModel::new(keyword_extraction_config).unwrap();// Credits: Wikimedia https://en.wikipedia.org/wiki/Rust_(programming_language)let output = keyword_extraction_model.predict(&input_strings).unwrap();
I am trying to extract keywords from sentences using the
all-MiniLM-L6-v2
modelWhen using this specific sentence (either alone or in combination with other sentences), the keyword extraction fails:
Up 3 Up 4 Down 2 Up 7 Up 2 Down 4 Down 4 Up 6 Up 1 Down 1 Down 3
I know this may not be a meaningful sentence, but it should not cause all sentences to not be evaluated
Is there a way to fix this, or to know which sentences would fail during evaluation?
This is my repro sample: crash-repro-keywords.zip
It contains this code snippet for evaluating the sentence:
This is the error that is printed:
This is the stack trace:
The text was updated successfully, but these errors were encountered: