From eb6f07ab5bf04d74473cc963c9927bdeedb56c14 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Dominik=20Pa=C4=BEo?= Date: Sun, 26 Nov 2023 11:56:55 +0100 Subject: [PATCH] feat:last commit --- backend/app.py | 17 ++---------- backend/output.txt | 40 +++++++++++++++++++++------ backend/{files => }/scraped_data.pdf | Bin backend/summarization.py | 23 ++++++++------- 4 files changed, 47 insertions(+), 33 deletions(-) rename backend/{files => }/scraped_data.pdf (100%) diff --git a/backend/app.py b/backend/app.py index 777f04d..00c1349 100644 --- a/backend/app.py +++ b/backend/app.py @@ -6,15 +6,10 @@ 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) @@ -22,7 +17,7 @@ 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) @@ -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+)", @@ -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() diff --git a/backend/output.txt b/backend/output.txt index dac8903..c419992 100644 --- a/backend/output.txt +++ b/backend/output.txt @@ -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. \ No newline at end of file +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. diff --git a/backend/files/scraped_data.pdf b/backend/scraped_data.pdf similarity index 100% rename from backend/files/scraped_data.pdf rename to backend/scraped_data.pdf diff --git a/backend/summarization.py b/backend/summarization.py index 39c481d..26a0e0a 100644 --- a/backend/summarization.py +++ b/backend/summarization.py @@ -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()