-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Integrated nlpcloud and fixed frontend
- Loading branch information
Ashish Rao
authored and
Ashish Rao
committed
Jan 24, 2023
1 parent
cd8c588
commit 56d4be8
Showing
60 changed files
with
68,645 additions
and
1,030 deletions.
There are no files selected for viewing
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 | ||
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 | ||
prosecution |
Binary file not shown.
Binary file not shown.
Binary file not shown.
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.