Skip to content

Commit

Permalink
Integrated nlpcloud and fixed frontend
Browse files Browse the repository at this point in the history
  • Loading branch information
Ashish Rao authored and Ashish Rao committed Jan 24, 2023
1 parent cd8c588 commit 56d4be8
Show file tree
Hide file tree
Showing 60 changed files with 68,645 additions and 1,030 deletions.
Binary file added .DS_Store
Binary file not shown.
Binary file modified Lira/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified Lira/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file modified Lira/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file modified Lira/__pycache__/settings.cpython-310.pyc
Binary file not shown.
Binary file modified Lira/__pycache__/settings.cpython-37.pyc
Binary file not shown.
Binary file modified Lira/__pycache__/settings.cpython-38.pyc
Binary file not shown.
Binary file modified Lira/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified Lira/__pycache__/urls.cpython-37.pyc
Binary file not shown.
Binary file modified Lira/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file modified Lira/__pycache__/wsgi.cpython-310.pyc
Binary file not shown.
Binary file modified Lira/__pycache__/wsgi.cpython-37.pyc
Binary file not shown.
Binary file modified Lira/__pycache__/wsgi.cpython-38.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/admin.cpython-310.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/admin.cpython-37.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/admin.cpython-38.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/apps.cpython-310.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/apps.cpython-37.pyc
Binary file not shown.
Binary file added Recommender/__pycache__/apps.cpython-38.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/models.cpython-310.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/models.cpython-37.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/models.cpython-38.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/urls.cpython-310.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/urls.cpython-37.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/urls.cpython-38.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/views.cpython-310.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/views.cpython-37.pyc
Binary file not shown.
Binary file modified Recommender/__pycache__/views.cpython-38.pyc
Binary file not shown.
32 changes: 32 additions & 0 deletions Recommender/automated_summary.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,32 @@
import pandas as pd
import nlpcloud
from nltk.tokenize import sent_tokenize
import time

data1 = pd.read_csv(r'../data/raw.csv',error_bad_lines=False, engine="python")
summaries_data = pd.read_csv(r'../data/summaries.csv')
client = nlpcloud.Client("bart-large-cnn", "f9c60f3620a2bdba081394bd77f44445c2a019b0")

for j in range(68,len(data1)):
text = data1['text'].iloc[j]
casename = data1['File Name'].iloc[j]
texts = sent_tokenize(text)
i = 0
steps = 40
summary_text = ''
print(j)
print(len(texts))
while i < len(texts):
print(f"{round(100 * (i / len(texts)),2)}%")
if i+steps < len(texts):
res = client.summarization(''.join(texts[i:i + steps]))
summary_text += res['summary_text'] + ' '
else:
res = client.summarization(''.join(texts[i:]))
summary_text += res['summary_text'] + ' '
print("Sleep time")
time.sleep(20)
i += steps
summary_row = summaries_data[summaries_data['File Name'] == casename].head(1).index
summaries_data.at[summary_row,'summary'] = summary_text
summaries_data.to_csv(r'../data/summaries.csv')
176 changes: 88 additions & 88 deletions Recommender/legal_stopwords.txt
Original file line number Diff line number Diff line change
@@ -1,88 +1,88 @@
Writ
Witness
Violation
Vacate
Venue
Transcript
Trial
Testimony
Summons
Charge
Sentences
Respondent
Prosecutor
Prosecute
Petitioner
Petition
Party
Order
Magistrate
Motion
Judge
Judgment
Defendant
AKA
Accelerated
Rehabilitation
Acknowledgment
Action
Adjournment
Adjudication
Adjudicatory
Court
Probation
Affirmation
Affidavit
Allegation
Annulment
Answer
Appeal
Appellant
Appellee
Arbitration
Arrest
Bail
Bar
Brief
Calendar
Case
Conference
Case
File
Certify
Challenge
Charge
Claim
Law
Complaint
Contract
Conviction
Cost
Count
Counter
Attorney
Officer
Court
Trial
Defendant
Delinquent
Deposition
Discovery
Dismissal
Finding
petitioners
three
accused
evidence
amendment
application
author
would
could
shall
may
dated
years
passed
print
prosecution
Writ
Witness
Violation
Vacate
Venue
Transcript
Trial
Testimony
Summons
Charge
Sentences
Respondent
Prosecutor
Prosecute
Petitioner
Petition
Party
Order
Magistrate
Motion
Judge
Judgment
Defendant
AKA
Accelerated
Rehabilitation
Acknowledgment
Action
Adjournment
Adjudication
Adjudicatory
Court
Probation
Affirmation
Affidavit
Allegation
Annulment
Answer
Appeal
Appellant
Appellee
Arbitration
Arrest
Bail
Bar
Brief
Calendar
Case
Conference
Case
File
Certify
Challenge
Charge
Claim
Law
Complaint
Contract
Conviction
Cost
Count
Counter
Attorney
Officer
Court
Trial
Defendant
Delinquent
Deposition
Discovery
Dismissal
Finding
petitioners
three
accused
evidence
amendment
application
author
would
could
shall
may
dated
years
passed
print
prosecution
Binary file modified Recommender/migrations/__pycache__/__init__.cpython-310.pyc
Binary file not shown.
Binary file modified Recommender/migrations/__pycache__/__init__.cpython-37.pyc
Binary file not shown.
Binary file modified Recommender/migrations/__pycache__/__init__.cpython-38.pyc
Binary file not shown.
3 changes: 0 additions & 3 deletions Recommender/summaries.csv

This file was deleted.

1 change: 0 additions & 1 deletion Recommender/summarizer.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,6 @@
data = pd.read_csv(r'../data/Mili_bank_forest_final.csv')
summaries_list = []
for i in range(len(data)):
print(i)
article_text = str(list(data['text'])[i])
article_text = re.sub(r'[[0-9]*]', ' ', article_text)
article_text = re.sub(r'\s+', ' ', article_text)
Expand Down
Loading

0 comments on commit 56d4be8

Please sign in to comment.