Shivam29rathore commited on
Commit
0c98223
·
1 Parent(s): 6635471

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +3 -3
app.py CHANGED
@@ -107,7 +107,7 @@ def finbert(word):
107
  data['Cluster'] = pd.Series(assigned_clusters, index = data.index)
108
  data['Centroid'] = data['Cluster'].apply(lambda x: Kclusterer.means()[x])
109
 
110
- # return the text if clustering algorithm catches an exceptiona and move to the next text file
111
  except ValueError:
112
  return text
113
 
@@ -122,7 +122,7 @@ def finbert(word):
122
  summary = " ".join(data.sort_values(
123
  'Distance_From_Centroid',
124
  ascending = True).groupby('Cluster').head(1).sort_index()['Sentences'].tolist())
125
- return ("FinBERT MODEL OUTPUT:--->"+summary," Length of Input:---->"+str(len(word))," Length of Output:----> "+str(len(summary)))
126
 
127
 
128
 
@@ -196,7 +196,7 @@ def pegasus(text):
196
  summary = [sentence for each in summary for sentence in each]
197
  final = "".join(summary)
198
 
199
- return ("FinBERT MODEL OUTPUT:--->"+final," Length of Input:---->"+str(len(text))," Length of Output:----> "+str(len(final)))
200
 
201
 
202
  import gradio as gr
 
107
  data['Cluster'] = pd.Series(assigned_clusters, index = data.index)
108
  data['Centroid'] = data['Cluster'].apply(lambda x: Kclusterer.means()[x])
109
 
110
+ # return the text if the clustering algorithm catches an exception and move to the next text file
111
  except ValueError:
112
  return text
113
 
 
122
  summary = " ".join(data.sort_values(
123
  'Distance_From_Centroid',
124
  ascending = True).groupby('Cluster').head(1).sort_index()['Sentences'].tolist())
125
+ return (summary," Length of Input:---->"+str(len(word))," Length of Output:----> "+str(len(summary)))
126
 
127
 
128
 
 
196
  summary = [sentence for each in summary for sentence in each]
197
  final = "".join(summary)
198
 
199
+ return (final," Length of Input:---->"+str(len(text))," Length of Output:----> "+str(len(final)))
200
 
201
 
202
  import gradio as gr