Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .github/workflows/pylint.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
name: Pylint

on: [push]

jobs:
build:
runs-on: ubuntu-latest
strategy:
matrix:
python-version: ["3.8", "3.9", "3.10"]
steps:
- uses: actions/checkout@v3
- name: Set up Python ${{ matrix.python-version }}
uses: actions/setup-python@v3
with:
python-version: ${{ matrix.python-version }}
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install pylint
- name: Analysing the code with pylint
run: |
pylint $(git ls-files '*.py')
39 changes: 39 additions & 0 deletions .github/workflows/python-publish.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,39 @@
# This workflow will upload a Python Package using Twine when a release is created
# For more information see: https://docs.github.com/en/actions/automating-builds-and-tests/building-and-testing-python#publishing-to-package-registries

# This workflow uses actions that are not certified by GitHub.
# They are provided by a third-party and are governed by
# separate terms of service, privacy policy, and support
# documentation.

name: Upload Python Package

on:
release:
types: [published]

permissions:
contents: read

jobs:
deploy:

runs-on: ubuntu-latest

steps:
- uses: actions/checkout@v3
- name: Set up Python
uses: actions/setup-python@v3
with:
python-version: '3.x'
- name: Install dependencies
run: |
python -m pip install --upgrade pip
pip install build
- name: Build package
run: python -m build
- name: Publish package
uses: pypa/gh-action-pypi-publish@27b31702a0e7fc50959f5ad993c78deac1bdfc29
with:
user: __token__
password: ${{ secrets.PYPI_API_TOKEN }}
Binary file not shown.
Binary file not shown.
28 changes: 28 additions & 0 deletions Index.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,28 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Legal AI App</title>
</head>
<body>
<h1>Legal AI App</h1>
<form action="/research" method="post">
<label for="query">Legal Research Query:</label>
<input type="text" id="query" name="query" required>
<button type="submit">Search</button>
</form>

<form action="/case_prediction" method="post">
<label for="case_details">Case Details:</label>
<input type="text" id="case_details" name="case_details" required>
<button type="submit">Predict Case Outcome</button>
</form>

<form action="/contract_review" method="post">
<label for="contract_text">Contract Text:</label>
<textarea id="contract_text" name="contract_text" required></textarea>
<button type="submit">Review Contract</button>
</form>
</body>
</html>
56 changes: 56 additions & 0 deletions Project.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
from flask import Flask, render_template, request
import openai

app = Flask(__name__)

# Set your OpenAI API key
openai.api_key = 'your_openai_api_key'

@app.route('/')
def index():
return render_template('index.html')

@app.route('/research', methods=['POST'])
def legal_research():
query = request.form['query']

# Use LLM for legal research (adapt based on OpenAI's API)
research_result = openai.Completion.create(
engine="text-davinci-003",
prompt=f"Legal research on: {query}",
temperature=0.7,
max_tokens=150
)

return render_template('result.html', result=research_result.choices[0].text)

@app.route('/case_prediction', methods=['POST'])
def case_prediction():
case_details = request.form['case_details']

# Use LLM for case outcome prediction (adapt based on OpenAI's API)
prediction_result = openai.Completion.create(
engine="text-davinci-003",
prompt=f"Case outcome prediction for: {case_details}",
temperature=0.7,
max_tokens=150
)

return render_template('result.html', result=prediction_result.choices[0].text)

@app.route('/contract_review', methods=['POST'])
def contract_review():
contract_text = request.form['contract_text']

# Use LLM for contract review (adapt based on OpenAI's API)
review_result = openai.Completion.create(
engine="text-davinci-003",
prompt=f"Contract review: {contract_text}",
temperature=0.7,
max_tokens=150
)

return render_template('result.html', result=review_result.choices[0].text)

if __name__ == '__main__':
app.run(debug=True)
34 changes: 34 additions & 0 deletions Project_2.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
from flask import Flask, render_template, request
import openai
from intel_analytics_tool import analyze_legal_text # Replace with the actual Intel analytics tool you're using

app = Flask(__name__)

# Set your OpenAI API key
openai.api_key = 'your_openai_api_key'

@app.route('/')
def index():
return render_template('index.html')

@app.route('/research', methods=['POST'])
def legal_research():
query = request.form['query']

# Use LLM for legal research (adapt based on OpenAI's API)
research_result = openai.Completion.create(
engine="text-davinci-003",
prompt=f"Legal research on: {query}",
temperature=0.7,
max_tokens=150
)

# Use Intel analytics tool for further analysis (replace with actual tool)
intel_analytics_result = analyze_legal_text(research_result.choices[0].text)

return render_template('result.html', result=intel_analytics_result)

# Add similar routes for case prediction and contract review

if __name__ == '__main__':
app.run(debug=True)
7 changes: 7 additions & 0 deletions Project_3.py
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
# This is a placeholder, replace with the actual implementation based on your Intel analytics tool
def analyze_legal_text(text):
# Implement the logic to use Intel AI analytics tools here
# For example, you might send the text to an Intel analytics service
# and receive the analyzed result
analyzed_result = f"Intel Analytics Result: {text}"
return analyzed_result
100 changes: 84 additions & 16 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,100 @@
# oneAPI-GenAI-Hackathon-2023 - Hack2Skill

Welcome to the official repository for the oneAPI-GenAI-Hackathon-2023 organized by Hack2Skill!

## Getting Started

To get started with the oneAPI-GenAI-Hackathon-2023 repository, follow these steps:

### Submission Instruction:
1. Fork this repository
2. Create a folder with your Team Name
3. Upload all the code and necessary files in the created folder
4. Upload a **README.md** file in your folder with the below mentioned informations.
5. Generate a Pull Request with your Team Name. (Example: submission-XYZ_team)

### README.md must consist of the following information:

#### Team Name -
#### Problem Statement -
#### Team Leader Email -

#### Team Name - Maveriks
#### Problem Statement - PROBLEM STATEMENT - 2
AI-Enhanced Legal Practice Platform
#### Team Leader Email [email protected]
### A Brief of the Prototype:
This section must include UML Diagrams and prototype description

LegalAssist is a prototype application that combines the power of OpenAI's Language Model (LLM), Intel Analytics Toolkit, and Intel Developer Cloud to create a comprehensive legal assistance tool. It provides a user-friendly interface for legal professionals to perform the following tasks:
**Legal Research:**
Quick access to relevant legal precedents, statutes, and case law.
Utilizes OpenAI's Language Model for natural language understanding and generation.
**Case Outcome Prediction:**
Predicts potential case outcomes based on historical data.
Integrates Intel Analytics Toolkit for additional legal analytics.
**Automated Contract Review:**
Identifies clauses, terms, and potential risks in contracts.
Leverages OpenAI's Language Model and Intel Analytics Toolkit for contract analysis.
### Tech Stack:
List Down all technologies used to Build the prototype

**Frontend:**
HTML, CSS, JavaScript
Flask (Python web framework)
**Backend:**
Python (Flask)
OpenAI GPT-3 (for LLM)
Intel Analytics Toolkit (for legal analytics)
**Deployment:**
Intel Developer Cloud
### Step-by-Step Code Execution Instructions:
This Section must contain a set of instructions required to clone and run the prototype so that it can be tested and deeply analyzed
**1.Clone the repository:**
**bash:**
Copy code
git clone https://github.com/yourusername/legalassist.git
cd legalassist

**2.Install dependencies:**
**bash**:
Copy code
pip install -r requirements.txt
Set up your OpenAI API key and Intel Developer Cloud access.

**3.Run the application:**
**bash:**
Copy code
python app.py
Open your web browser and navigate to 'Our_Website' to access LegalAssist.

### Future Scope:
Write about the scalability and futuristic aspects of the prototype developed
The LegalAssist prototype has significant potential for future enhancements and expansions. Here are some ideas for future scope:
**1.Advanced Legal Analytics:**
Explore and integrate more advanced legal analytics tools and algorithms for deeper insights into legal data.
Implement machine learning models to predict legal trends, helping legal professionals stay ahead of changing legal landscapes.
**2.Natural Language Processing (NLP) Improvements:**
Continuously enhance the natural language processing capabilities by fine-tuning OpenAI's Language Model or exploring more advanced NLP models.
Integrate sentiment analysis to understand the emotional tone of legal texts, providing additional context for users.
**3.User Feedback and Iteration:**
Implement a robust feedback mechanism for users to provide insights on the accuracy and usefulness of the legal research, case prediction, and contract review results.
Use user feedback to iterate on the models and improve the system's overall performance.
**4.Integration with Legal Databases:**
Integrate with legal databases and repositories to provide real-time access to the latest legal precedents, statutes, and case law.
Implement a feature for users to search and save relevant legal documents directly from the application.
**5.Collaboration Tools for Legal Professionals:**
Develop collaboration features that allow legal professionals to collaborate on research, share insights, and collectively analyze legal documents.
Implement version control for legal documents to track changes and updates.
**6.Cross-Platform Compatibility:**
Optimize the user interface for cross-platform compatibility, allowing legal professionals to access LegalAssist seamlessly on various devices, including tablets and smartphones.
**7.Legal Document Automation:**
Expand the automated contract review system to support document generation and automation.
Implement a system that generates standardized legal documents based on user input, reducing the manual effort in drafting contracts.
**8.Global Legal Research:**
Incorporate the capability to perform legal research across multiple jurisdictions, providing comprehensive information for legal professionals practicing in different regions.
**9.Security and Compliance Features:**
Enhance security measures to ensure the protection of sensitive legal information.
Implement compliance features to adhere to legal and data protection regulations, ensuring the application meets industry standards.
**10.Training and Education Module:**
Develop a module for legal professionals to stay updated on the latest legal technologies, tools, and best practices.
Provide training resources on how to effectively use AI-powered tools in legal research and analysis.
By exploring these future scope ideas, LegalAssist can evolve into a comprehensive and indispensable tool for legal professionals, enhancing their efficiency, accuracy, and collaboration in the dynamic field of law.

### What I Learned
Throughout the development of LegalAssist, our team gained valuable experience in integrating natural language processing models (LLM) into web applications. Additionally, we explored the capabilities of Intel's Analytics Toolkit for legal analytics, enhancing the overall functionality and insights provided by our legal assistance tool.
**TEAM DETAILS:**
1.TEAM LEADER:https://github.com/surrvezh
2.TEAM MEMEBER 1:https://github.com/Sid-047
3.TEAM MEMBER 2:https://github.com/Davidvedhajerome







13 changes: 13 additions & 0 deletions Result.html
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
<!DOCTYPE html>
<html lang="en">
<head>
<meta charset="UTF-8">
<meta name="viewport" content="width=device-width, initial-scale=1.0">
<title>Legal AI App - Result</title>
</head>
<body>
<h2>Result:</h2>
<p>{{ result }}</p>
<a href="/">Back to Home</a>
</body>
</html>