Spaces:
Build error
Build error
Commit
·
5fa911d
1
Parent(s):
5a74a94
Update app.py
Browse files
app.py
CHANGED
|
@@ -4,6 +4,17 @@ from mosestokenizer import *
|
|
| 4 |
from indicnlp.tokenize import sentence_tokenize
|
| 5 |
from docx import Document
|
| 6 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 7 |
trans_tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M" )
|
| 8 |
trans_model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
|
| 9 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
@@ -487,7 +498,7 @@ def run_generate_questions(document_name, output_file, questions_file, delimiter
|
|
| 487 |
return qg_output, q_output
|
| 488 |
|
| 489 |
|
| 490 |
-
|
| 491 |
import random
|
| 492 |
from docx.shared import RGBColor
|
| 493 |
import time
|
|
@@ -515,7 +526,7 @@ def run_redflags(filename, output_file):
|
|
| 515 |
return output_file
|
| 516 |
|
| 517 |
|
| 518 |
-
|
| 519 |
import random
|
| 520 |
from docx.shared import RGBColor
|
| 521 |
import time
|
|
@@ -637,7 +648,7 @@ def run_similar_clause(filename, output_file, clauses, source_language):
|
|
| 637 |
return output_file, highlighted_paras
|
| 638 |
|
| 639 |
|
| 640 |
-
|
| 641 |
|
| 642 |
analysis_services = ['Translate Contract', 'Identify key Clauses', 'Red flag Identification', 'Similar Semantic Clause search', 'Generate Questions for Contract Template']
|
| 643 |
analysis_label = 'Select Contract Analysis Service'
|
|
|
|
| 4 |
from indicnlp.tokenize import sentence_tokenize
|
| 5 |
from docx import Document
|
| 6 |
|
| 7 |
+
import os
|
| 8 |
+
|
| 9 |
+
os.system('git clone https://github.com/TheAtticusProject/cuad.git')
|
| 10 |
+
os.system('mv cuad cuad-training')
|
| 11 |
+
os.system('unzip cuad-training/data.zip -d cuad-data/')
|
| 12 |
+
os.system('mkdir cuad-models')
|
| 13 |
+
os.system('curl https://zenodo.org/record/4599830/files/roberta-base.zip?download=1 --output cuad-models/roberta-base.zip')
|
| 14 |
+
os.system('unzip cuad-models/roberta-base.zip -d cuad-models/')
|
| 15 |
+
|
| 16 |
+
|
| 17 |
+
|
| 18 |
trans_tokenizer = AutoTokenizer.from_pretrained("facebook/nllb-200-distilled-600M" )
|
| 19 |
trans_model = AutoModelForSeq2SeqLM.from_pretrained("facebook/nllb-200-distilled-600M")
|
| 20 |
device = torch.device("cuda" if torch.cuda.is_available() else "cpu")
|
|
|
|
| 498 |
return qg_output, q_output
|
| 499 |
|
| 500 |
|
| 501 |
+
import docx
|
| 502 |
import random
|
| 503 |
from docx.shared import RGBColor
|
| 504 |
import time
|
|
|
|
| 526 |
return output_file
|
| 527 |
|
| 528 |
|
| 529 |
+
import docx
|
| 530 |
import random
|
| 531 |
from docx.shared import RGBColor
|
| 532 |
import time
|
|
|
|
| 648 |
return output_file, highlighted_paras
|
| 649 |
|
| 650 |
|
| 651 |
+
import gradio as gr
|
| 652 |
|
| 653 |
analysis_services = ['Translate Contract', 'Identify key Clauses', 'Red flag Identification', 'Similar Semantic Clause search', 'Generate Questions for Contract Template']
|
| 654 |
analysis_label = 'Select Contract Analysis Service'
|