Skip to content

Commit

Permalink
feat:last commit
Browse files Browse the repository at this point in the history
  • Loading branch information
Dospalko committed Nov 26, 2023
1 parent 1d08d86 commit eb6f07a
Show file tree
Hide file tree
Showing 4 changed files with 47 additions and 33 deletions.
17 changes: 3 additions & 14 deletions backend/app.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,23 +6,18 @@
from PyPDF2 import PdfReader
import re
import openai
import sklearn
import pandas as pd
#from prettier import pretty
from summarization import summarizate

# Configure OpenAI with your API Key
from joblib import load
# Load your trained model


app = Flask(__name__)
CORS(app)
app.config['SQLALCHEMY_DATABASE_URI'] = 'postgresql://postgres:heslo@localhost/hackathon'

db = SQLAlchemy(app)
migrate = Migrate(app, db)
model = load('model/my_model.joblib')

class PdfText(db.Model):
id = db.Column(db.Integer, primary_key=True)
text = db.Column(db.Text)
Expand Down Expand Up @@ -126,10 +121,9 @@ def input_data(pdf_text_id):
pdf_summary = PdfSummary.query.filter_by(pdf_text_id=pdf_text_id).first()
if pdf_summary:
summary_text = pdf_summary.summary_text

# Define patterns for each parameter
patterns = {
'ProblemStatement': r"Problem Statement:.*?Score: (\d+)",
'ScopeOfWork': r"Scope of Work:.*?Score: (\d+)",
'RequiredTechnologyStack': r"Required Technology Stack:.*?Score: (\d+)",
'PricingModel': r"Pricing Model:.*?Score: (\d+)",
Expand All @@ -150,18 +144,13 @@ def input_data(pdf_text_id):
score_value = score
extracted_data[key] = score_value
else:
extracted_data[key] = None # or some default value
extracted_data[key] = 0 # or some default value

if extracted_data:
return jsonify(extracted_data)
else:
return jsonify({"message": "PDF Summary not found"}), 404

def predict_loan_payment(input_data):
input_data = pd.DataFrame(input_data, index=[0])
prediction = model.predict(input_data) # Use the .predict() method
return prediction[0]

def init_db():
db.create_all()

Expand Down
40 changes: 31 additions & 9 deletions backend/output.txt
Original file line number Diff line number Diff line change
@@ -1,11 +1,33 @@
Summary:
Evaluation Summary:

The State of Tennessee Department of General Services is issuing a Request for Information (RFI) for the procurement of operation and maintenance services for a water and wastewater facility in West Tennessee. This RFI comes after the cancellation of a previous Request for Proposals (RFP) due to the State's inability to agree on terms with potential awardees. The Megasite Authority of West Tennessee is seeking proposals for a public-private partnership to manage and maintain the water and wastewater infrastructure owned by the Authority. The respondent will be responsible for staffing, training, maintenance, and regulatory compliance. The agreement between the Authority and the respondent will be for a duration of ten years, with the possibility of annual price adjustments based on legal or regulatory changes. The respondent will also be responsible for biosolids management and disposal. Interested parties are requested to fill out a technical informational form and a cost informational form, as well as provide feedback on a draft RFP and Pro Forma Contract.
1. Problem Statement:
The RFP does not provide a specific problem statement but it does mention the need for software development resources to aid in the customer on-boarding process. Score: 7

Analysis:
- The RFI is issued to procure operation and maintenance services for a water and wastewater facility in West Tennessee.
- The cancellation of a previous RFP prompts the State to seek vigorous competition and identify potential issues in the industry.
- The Megasite Authority of West Tennessee intends to enter into a public-private partnership for the management of the infrastructure.
- The respondent will be responsible for staffing, training, maintenance, regulatory compliance, and biosolids management.
- The agreement between the Authority and the respondent will be for ten years, with possible annual price adjustments based on changes in regulations or project requirements.
- Interested parties are required to fill out technical and cost informational forms, as well as provide feedback on a draft RFP and Pro Forma Contract.
2. Scope of Work:
The RFP clearly defines the work such as software development, related to improving customer on-boarding process. Our company has expertise in software development, UI/UX design, and API integration. Therefore, our services align well with the RFP's scope of work. Score: 10

3. Required Technology Stack:
The RFP specifies the required technology stack such as Java, .Net, and related technologies. Our company is equipped with expertise in these, therefore it aligns with our capabilities. Score: 10

4. Pricing Model:
The RFP does not specify a pricing model, preferring to be informed by the bidder. Our company is experienced in providing flexible pricing models, tailored to the needs of the project. Score: 8

5. Service Level Agreements (SLAs):
The RFP doesn't provide clear information regarding SLAs. However, with our experience in crafting detailed Service Level Agreements (SLAs) we can propose robust SLAs to satisfy the bank's needs. Score: 7

6. Selection Criteria:
The selection criteria outlined in the RFP comprehensively covers aspects such as company experience, technical capabilities, pricing, and quality of services. Our company aligns with these, being a mature company with a diverse portfolio. Score: 9

7. Timelines:
The RFP lacks specific timelines which can cause ambiguity. Our company is capable of working within specified timelines, provided they are given. Score: 5

8. Contact Details:
The RFP provides appropriate contact details, making it easy for our company to reach out for clarifications or information. Score: 10

9. Penalty Clauses:
Penalty clauses are well defined in the RFP. This provides clarity on the consequences of not meeting the terms of the agreement. Our company is committed to deliver in line with the agreed terms to avoid penalties. Score: 10

10. Required Offer Type:
The RFP doesn’t specifically mention an offer type but requests for a comprehensive bid responding to their requirements. Our company is well equipped to provide such a comprehensive response. Score: 7

Overall, the company's capabilities align well with the requirements of this RFP, with minor clarifications needed to further ensure compatibility.
File renamed without changes.
23 changes: 13 additions & 10 deletions backend/summarization.py
Original file line number Diff line number Diff line change
Expand Up @@ -50,16 +50,19 @@ def summarizate(text):
assistant = client.beta.assistants.create(
name="Summarize Bot",
instructions="""Your role is to evaluate Request for Proposals (RFPs) against a company's capabilities,
with detailed scoring for each aspect. Begin with 'First of file' for the company profile, and then 'Second of
file' for the RFP, concluding at 'End of file'. Focus solely on the text between these markers. After both texts
are presented, assess whether the company can fulfill the RFP, scoring each aspect from 0 to 10. Maintain a
professional tone. Evaluate these aspects of the RFP in relation to the company's capabilities: Problem
Statement, Scope of Work, Required Technology Stack, Pricing Model, Service Level Agreements (SLAs),
Selection Criteria, Timelines, Contact Details, Penalty Clauses, Required Offer Type. Clearly indicate if any
aspect is not detailed in the RFP. Avoid partial summaries; complete your analysis only after reviewing both the
company profile and RFP. This approach ensures a thorough and focused evaluation.""",
model="gpt-4",
)
with detailed scoring for each aspect. Begin with 'First of file' for the company profile, and then 'Second
of file' for the RFP, concluding at 'End of file'. Focus solely on the text between these markers. After both
texts are presented, assess whether the company can fulfill the RFP, scoring each aspect from 0 to 10(score
must be at the end of each point, like that "Score:(number)" ). Maintain a professional tone. Evaluate these
aspects of the RFP in relation to the company's capabilities: Problem Statement, Scope of Work,
Required Technology Stack, Pricing Model, Service Level Agreements (SLAs), Selection Criteria, Timelines,
Contact Details, Penalty Clauses, Required Offer Type. Clearly indicate if any aspect is not detailed in the
RFP. Avoid partial summaries; complete your analysis only after reviewing both the company profile and RFP.
This approach ensures a thorough and focused evaluation.""",
model="gpt-4",
)



# Create a thread
thread = client.beta.threads.create()
Expand Down

0 comments on commit eb6f07a

Please sign in to comment.