abdulmatinomotoso commited on
Commit
db64e00
1 Parent(s): 0588895

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -1
app.py CHANGED
@@ -7,8 +7,8 @@ from sentence_transformers import SentenceTransformer
7
  from keybert import KeyBERT
8
  from keyphrase_vectorizers import KeyphraseCountVectorizer
9
 
10
- # Defining a function to read in the text file
11
 
 
12
  def read_in_text(url):
13
  with open(url, 'r') as file:
14
  article = file.read()
@@ -17,6 +17,7 @@ def read_in_text(url):
17
  #tmp_model = SentenceTransformer('valurank/MiniLM-L6-Keyword-Extraction')
18
  kw_extractor = KeyBERT('valurank/MiniLM-L6-Keyword-Extraction')
19
 
 
20
  def get_keybert_results_with_vectorizer(text, number_of_results=20):
21
  try:
22
  keywords = kw_extractor.extract_keywords(text, vectorizer=KeyphraseCountVectorizer(), stop_words=None, top_n=number_of_results)
 
7
  from keybert import KeyBERT
8
  from keyphrase_vectorizers import KeyphraseCountVectorizer
9
 
 
10
 
11
+ # Defining a function to read in the text file
12
  def read_in_text(url):
13
  with open(url, 'r') as file:
14
  article = file.read()
 
17
  #tmp_model = SentenceTransformer('valurank/MiniLM-L6-Keyword-Extraction')
18
  kw_extractor = KeyBERT('valurank/MiniLM-L6-Keyword-Extraction')
19
 
20
+
21
  def get_keybert_results_with_vectorizer(text, number_of_results=20):
22
  try:
23
  keywords = kw_extractor.extract_keywords(text, vectorizer=KeyphraseCountVectorizer(), stop_words=None, top_n=number_of_results)