dgotlieb commited on
Commit
e873b25
·
verified ·
1 Parent(s): bb9f5cc

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -2
app.py CHANGED
@@ -2,7 +2,6 @@ import gradio as gr
2
  from transformers import pipeline
3
 
4
  # Load a stable keyword extraction model once
5
- # This model is specifically designed for keyword extraction
6
  pipe = pipeline("token-classification", model="ml6team/keyphrase-extraction-distilbert-inspec", aggregation_strategy="simple")
7
 
8
  def extract_keywords(text):
@@ -11,7 +10,6 @@ def extract_keywords(text):
11
  """
12
  try:
13
  keywords = pipe(text)
14
- # The model returns a list of dictionaries, let's extract the words
15
  if not keywords:
16
  return "No keywords found."
17
 
 
2
  from transformers import pipeline
3
 
4
  # Load a stable keyword extraction model once
 
5
  pipe = pipeline("token-classification", model="ml6team/keyphrase-extraction-distilbert-inspec", aggregation_strategy="simple")
6
 
7
  def extract_keywords(text):
 
10
  """
11
  try:
12
  keywords = pipe(text)
 
13
  if not keywords:
14
  return "No keywords found."
15