Gabriel commited on
Commit
c88e4f0
1 Parent(s): c47dd83

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -3
app.py CHANGED
@@ -16,12 +16,11 @@ def lex_rank(in_text, threshold=None , model_in = 'KBLab/sentence-bert-swedish-c
16
 
17
  model = SentenceTransformer(model_in)
18
  #Split the document into sentences
19
- sentences = nltk.sent_tokenize(document, language=language)
20
- print("1")
21
  #Compute the sentence embeddings
22
  embeddings = model.encode(sentences, convert_to_tensor=True)
23
  cos_scores = util.cos_sim(embeddings, embeddings).cpu().numpy()
24
- print("2")
25
 
26
  #Compute the centrality for each sentence
27
  centrality_scores = degree_centrality_scores(cos_scores, threshold=threshold)
 
16
 
17
  model = SentenceTransformer(model_in)
18
  #Split the document into sentences
19
+ sentences = nltk.sent_tokenize(in_text, language=language)
20
+
21
  #Compute the sentence embeddings
22
  embeddings = model.encode(sentences, convert_to_tensor=True)
23
  cos_scores = util.cos_sim(embeddings, embeddings).cpu().numpy()
 
24
 
25
  #Compute the centrality for each sentence
26
  centrality_scores = degree_centrality_scores(cos_scores, threshold=threshold)