+ Upon analyzing the data provided, it appears that there's a recurring pattern in the claims regarding a leaking roof, despite our humidity sensors reporting no significant changes in the moisture levels. The lack of corresponding data indicating repairs or remedial action suggests a possible attempt to exploit the insurance policy. This consistent reporting of the same issue without any observable improvements or evidence of repair raises concerns of potential insurance fraud. We recommend further investigation into the validity of these claims to prevent potential fraudulent activities.
+
+ )}
+
+
+
+
+
+
+
Sensor Graphs
+
+
+
+
+
+
+
Previous User Claims
+
+
+
Claim ID: 26654
+
Claim Description: Leaky roof resulting in water damage
+
Claim Date: 01/26/24
+
+
+
Claim ID: 26578
+
Claim Description: Broken fence due to hailstorm
+
Claim Date: 08/15/23
+
+
+
Claim ID: 36591
+
Claim Description: Leaky roof resulting in water damage
+
Claim Date: 03/27/23
+
-
- Click on the Vite and React logos to learn more
-
- >
- )
+
+
+ );
}
-export default App
+export default App;
diff --git a/src/index.css b/src/index.css
index 6119ad9..e69de29 100644
--- a/src/index.css
+++ b/src/index.css
@@ -1,68 +0,0 @@
-:root {
- font-family: Inter, system-ui, Avenir, Helvetica, Arial, sans-serif;
- line-height: 1.5;
- font-weight: 400;
-
- color-scheme: light dark;
- color: rgba(255, 255, 255, 0.87);
- background-color: #242424;
-
- font-synthesis: none;
- text-rendering: optimizeLegibility;
- -webkit-font-smoothing: antialiased;
- -moz-osx-font-smoothing: grayscale;
-}
-
-a {
- font-weight: 500;
- color: #646cff;
- text-decoration: inherit;
-}
-a:hover {
- color: #535bf2;
-}
-
-body {
- margin: 0;
- display: flex;
- place-items: center;
- min-width: 320px;
- min-height: 100vh;
-}
-
-h1 {
- font-size: 3.2em;
- line-height: 1.1;
-}
-
-button {
- border-radius: 8px;
- border: 1px solid transparent;
- padding: 0.6em 1.2em;
- font-size: 1em;
- font-weight: 500;
- font-family: inherit;
- background-color: #1a1a1a;
- cursor: pointer;
- transition: border-color 0.25s;
-}
-button:hover {
- border-color: #646cff;
-}
-button:focus,
-button:focus-visible {
- outline: 4px auto -webkit-focus-ring-color;
-}
-
-@media (prefers-color-scheme: light) {
- :root {
- color: #213547;
- background-color: #ffffff;
- }
- a:hover {
- color: #747bff;
- }
- button {
- background-color: #f9f9f9;
- }
-}
diff --git a/src/input.css b/src/input.css
new file mode 100644
index 0000000..a90f074
--- /dev/null
+++ b/src/input.css
@@ -0,0 +1,4 @@
+@tailwind base;
+@tailwind components;
+@tailwind utilities;
+
diff --git a/src/output.css b/src/output.css
new file mode 100644
index 0000000..15f5704
--- /dev/null
+++ b/src/output.css
@@ -0,0 +1,558 @@
+/*
+! tailwindcss v3.4.1 | MIT License | https://tailwindcss.com
+*/
+
+/*
+1. Prevent padding and border from affecting element width. (https://github.com/mozdevs/cssremedy/issues/4)
+2. Allow adding a border to an element by just adding a border-width. (https://github.com/tailwindcss/tailwindcss/pull/116)
+*/
+
+*,
+::before,
+::after {
+ box-sizing: border-box;
+ /* 1 */
+ border-width: 0;
+ /* 2 */
+ border-style: solid;
+ /* 2 */
+ border-color: #e5e7eb;
+ /* 2 */
+}
+
+::before,
+::after {
+ --tw-content: '';
+}
+
+/*
+1. Use a consistent sensible line-height in all browsers.
+2. Prevent adjustments of font size after orientation changes in iOS.
+3. Use a more readable tab size.
+4. Use the user's configured `sans` font-family by default.
+5. Use the user's configured `sans` font-feature-settings by default.
+6. Use the user's configured `sans` font-variation-settings by default.
+7. Disable tap highlights on iOS
+*/
+
+html,
+:host {
+ line-height: 1.5;
+ /* 1 */
+ -webkit-text-size-adjust: 100%;
+ /* 2 */
+ -moz-tab-size: 4;
+ /* 3 */
+ -o-tab-size: 4;
+ tab-size: 4;
+ /* 3 */
+ font-family: ui-sans-serif, system-ui, sans-serif, "Apple Color Emoji", "Segoe UI Emoji", "Segoe UI Symbol", "Noto Color Emoji";
+ /* 4 */
+ font-feature-settings: normal;
+ /* 5 */
+ font-variation-settings: normal;
+ /* 6 */
+ -webkit-tap-highlight-color: transparent;
+ /* 7 */
+}
+
+/*
+1. Remove the margin in all browsers.
+2. Inherit line-height from `html` so users can set them as a class directly on the `html` element.
+*/
+
+body {
+ margin: 0;
+ /* 1 */
+ line-height: inherit;
+ /* 2 */
+}
+
+/*
+1. Add the correct height in Firefox.
+2. Correct the inheritance of border color in Firefox. (https://bugzilla.mozilla.org/show_bug.cgi?id=190655)
+3. Ensure horizontal rules are visible by default.
+*/
+
+hr {
+ height: 0;
+ /* 1 */
+ color: inherit;
+ /* 2 */
+ border-top-width: 1px;
+ /* 3 */
+}
+
+/*
+Add the correct text decoration in Chrome, Edge, and Safari.
+*/
+
+abbr:where([title]) {
+ -webkit-text-decoration: underline dotted;
+ text-decoration: underline dotted;
+}
+
+/*
+Remove the default font size and weight for headings.
+*/
+
+h1,
+h2,
+h3,
+h4,
+h5,
+h6 {
+ font-size: inherit;
+ font-weight: inherit;
+}
+
+/*
+Reset links to optimize for opt-in styling instead of opt-out.
+*/
+
+a {
+ color: inherit;
+ text-decoration: inherit;
+}
+
+/*
+Add the correct font weight in Edge and Safari.
+*/
+
+b,
+strong {
+ font-weight: bolder;
+}
+
+/*
+1. Use the user's configured `mono` font-family by default.
+2. Use the user's configured `mono` font-feature-settings by default.
+3. Use the user's configured `mono` font-variation-settings by default.
+4. Correct the odd `em` font sizing in all browsers.
+*/
+
+code,
+kbd,
+samp,
+pre {
+ font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
+ /* 1 */
+ font-feature-settings: normal;
+ /* 2 */
+ font-variation-settings: normal;
+ /* 3 */
+ font-size: 1em;
+ /* 4 */
+}
+
+/*
+Add the correct font size in all browsers.
+*/
+
+small {
+ font-size: 80%;
+}
+
+/*
+Prevent `sub` and `sup` elements from affecting the line height in all browsers.
+*/
+
+sub,
+sup {
+ font-size: 75%;
+ line-height: 0;
+ position: relative;
+ vertical-align: baseline;
+}
+
+sub {
+ bottom: -0.25em;
+}
+
+sup {
+ top: -0.5em;
+}
+
+/*
+1. Remove text indentation from table contents in Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=999088, https://bugs.webkit.org/show_bug.cgi?id=201297)
+2. Correct table border color inheritance in all Chrome and Safari. (https://bugs.chromium.org/p/chromium/issues/detail?id=935729, https://bugs.webkit.org/show_bug.cgi?id=195016)
+3. Remove gaps between table borders by default.
+*/
+
+table {
+ text-indent: 0;
+ /* 1 */
+ border-color: inherit;
+ /* 2 */
+ border-collapse: collapse;
+ /* 3 */
+}
+
+/*
+1. Change the font styles in all browsers.
+2. Remove the margin in Firefox and Safari.
+3. Remove default padding in all browsers.
+*/
+
+button,
+input,
+optgroup,
+select,
+textarea {
+ font-family: inherit;
+ /* 1 */
+ font-feature-settings: inherit;
+ /* 1 */
+ font-variation-settings: inherit;
+ /* 1 */
+ font-size: 100%;
+ /* 1 */
+ font-weight: inherit;
+ /* 1 */
+ line-height: inherit;
+ /* 1 */
+ color: inherit;
+ /* 1 */
+ margin: 0;
+ /* 2 */
+ padding: 0;
+ /* 3 */
+}
+
+/*
+Remove the inheritance of text transform in Edge and Firefox.
+*/
+
+button,
+select {
+ text-transform: none;
+}
+
+/*
+1. Correct the inability to style clickable types in iOS and Safari.
+2. Remove default button styles.
+*/
+
+button,
+[type='button'],
+[type='reset'],
+[type='submit'] {
+ -webkit-appearance: button;
+ /* 1 */
+ background-color: transparent;
+ /* 2 */
+ background-image: none;
+ /* 2 */
+}
+
+/*
+Use the modern Firefox focus style for all focusable elements.
+*/
+
+:-moz-focusring {
+ outline: auto;
+}
+
+/*
+Remove the additional `:invalid` styles in Firefox. (https://github.com/mozilla/gecko-dev/blob/2f9eacd9d3d995c937b4251a5557d95d494c9be1/layout/style/res/forms.css#L728-L737)
+*/
+
+:-moz-ui-invalid {
+ box-shadow: none;
+}
+
+/*
+Add the correct vertical alignment in Chrome and Firefox.
+*/
+
+progress {
+ vertical-align: baseline;
+}
+
+/*
+Correct the cursor style of increment and decrement buttons in Safari.
+*/
+
+::-webkit-inner-spin-button,
+::-webkit-outer-spin-button {
+ height: auto;
+}
+
+/*
+1. Correct the odd appearance in Chrome and Safari.
+2. Correct the outline style in Safari.
+*/
+
+[type='search'] {
+ -webkit-appearance: textfield;
+ /* 1 */
+ outline-offset: -2px;
+ /* 2 */
+}
+
+/*
+Remove the inner padding in Chrome and Safari on macOS.
+*/
+
+::-webkit-search-decoration {
+ -webkit-appearance: none;
+}
+
+/*
+1. Correct the inability to style clickable types in iOS and Safari.
+2. Change font properties to `inherit` in Safari.
+*/
+
+::-webkit-file-upload-button {
+ -webkit-appearance: button;
+ /* 1 */
+ font: inherit;
+ /* 2 */
+}
+
+/*
+Add the correct display in Chrome and Safari.
+*/
+
+summary {
+ display: list-item;
+}
+
+/*
+Removes the default spacing and border for appropriate elements.
+*/
+
+blockquote,
+dl,
+dd,
+h1,
+h2,
+h3,
+h4,
+h5,
+h6,
+hr,
+figure,
+p,
+pre {
+ margin: 0;
+}
+
+fieldset {
+ margin: 0;
+ padding: 0;
+}
+
+legend {
+ padding: 0;
+}
+
+ol,
+ul,
+menu {
+ list-style: none;
+ margin: 0;
+ padding: 0;
+}
+
+/*
+Reset default styling for dialogs.
+*/
+
+dialog {
+ padding: 0;
+}
+
+/*
+Prevent resizing textareas horizontally by default.
+*/
+
+textarea {
+ resize: vertical;
+}
+
+/*
+1. Reset the default placeholder opacity in Firefox. (https://github.com/tailwindlabs/tailwindcss/issues/3300)
+2. Set the default placeholder color to the user's configured gray 400 color.
+*/
+
+input::-moz-placeholder, textarea::-moz-placeholder {
+ opacity: 1;
+ /* 1 */
+ color: #9ca3af;
+ /* 2 */
+}
+
+input::placeholder,
+textarea::placeholder {
+ opacity: 1;
+ /* 1 */
+ color: #9ca3af;
+ /* 2 */
+}
+
+/*
+Set the default cursor for buttons.
+*/
+
+button,
+[role="button"] {
+ cursor: pointer;
+}
+
+/*
+Make sure disabled buttons don't get the pointer cursor.
+*/
+
+:disabled {
+ cursor: default;
+}
+
+/*
+1. Make replaced elements `display: block` by default. (https://github.com/mozdevs/cssremedy/issues/14)
+2. Add `vertical-align: middle` to align replaced elements more sensibly by default. (https://github.com/jensimmons/cssremedy/issues/14#issuecomment-634934210)
+ This can trigger a poorly considered lint error in some tools but is included by design.
+*/
+
+img,
+svg,
+video,
+canvas,
+audio,
+iframe,
+embed,
+object {
+ display: block;
+ /* 1 */
+ vertical-align: middle;
+ /* 2 */
+}
+
+/*
+Constrain images and videos to the parent width and preserve their intrinsic aspect ratio. (https://github.com/mozdevs/cssremedy/issues/14)
+*/
+
+img,
+video {
+ max-width: 100%;
+ height: auto;
+}
+
+/* Make elements with the HTML hidden attribute stay hidden by default */
+
+[hidden] {
+ display: none;
+}
+
+*, ::before, ::after {
+ --tw-border-spacing-x: 0;
+ --tw-border-spacing-y: 0;
+ --tw-translate-x: 0;
+ --tw-translate-y: 0;
+ --tw-rotate: 0;
+ --tw-skew-x: 0;
+ --tw-skew-y: 0;
+ --tw-scale-x: 1;
+ --tw-scale-y: 1;
+ --tw-pan-x: ;
+ --tw-pan-y: ;
+ --tw-pinch-zoom: ;
+ --tw-scroll-snap-strictness: proximity;
+ --tw-gradient-from-position: ;
+ --tw-gradient-via-position: ;
+ --tw-gradient-to-position: ;
+ --tw-ordinal: ;
+ --tw-slashed-zero: ;
+ --tw-numeric-figure: ;
+ --tw-numeric-spacing: ;
+ --tw-numeric-fraction: ;
+ --tw-ring-inset: ;
+ --tw-ring-offset-width: 0px;
+ --tw-ring-offset-color: #fff;
+ --tw-ring-color: rgb(59 130 246 / 0.5);
+ --tw-ring-offset-shadow: 0 0 #0000;
+ --tw-ring-shadow: 0 0 #0000;
+ --tw-shadow: 0 0 #0000;
+ --tw-shadow-colored: 0 0 #0000;
+ --tw-blur: ;
+ --tw-brightness: ;
+ --tw-contrast: ;
+ --tw-grayscale: ;
+ --tw-hue-rotate: ;
+ --tw-invert: ;
+ --tw-saturate: ;
+ --tw-sepia: ;
+ --tw-drop-shadow: ;
+ --tw-backdrop-blur: ;
+ --tw-backdrop-brightness: ;
+ --tw-backdrop-contrast: ;
+ --tw-backdrop-grayscale: ;
+ --tw-backdrop-hue-rotate: ;
+ --tw-backdrop-invert: ;
+ --tw-backdrop-opacity: ;
+ --tw-backdrop-saturate: ;
+ --tw-backdrop-sepia: ;
+}
+
+::backdrop {
+ --tw-border-spacing-x: 0;
+ --tw-border-spacing-y: 0;
+ --tw-translate-x: 0;
+ --tw-translate-y: 0;
+ --tw-rotate: 0;
+ --tw-skew-x: 0;
+ --tw-skew-y: 0;
+ --tw-scale-x: 1;
+ --tw-scale-y: 1;
+ --tw-pan-x: ;
+ --tw-pan-y: ;
+ --tw-pinch-zoom: ;
+ --tw-scroll-snap-strictness: proximity;
+ --tw-gradient-from-position: ;
+ --tw-gradient-via-position: ;
+ --tw-gradient-to-position: ;
+ --tw-ordinal: ;
+ --tw-slashed-zero: ;
+ --tw-numeric-figure: ;
+ --tw-numeric-spacing: ;
+ --tw-numeric-fraction: ;
+ --tw-ring-inset: ;
+ --tw-ring-offset-width: 0px;
+ --tw-ring-offset-color: #fff;
+ --tw-ring-color: rgb(59 130 246 / 0.5);
+ --tw-ring-offset-shadow: 0 0 #0000;
+ --tw-ring-shadow: 0 0 #0000;
+ --tw-shadow: 0 0 #0000;
+ --tw-shadow-colored: 0 0 #0000;
+ --tw-blur: ;
+ --tw-brightness: ;
+ --tw-contrast: ;
+ --tw-grayscale: ;
+ --tw-hue-rotate: ;
+ --tw-invert: ;
+ --tw-saturate: ;
+ --tw-sepia: ;
+ --tw-drop-shadow: ;
+ --tw-backdrop-blur: ;
+ --tw-backdrop-brightness: ;
+ --tw-backdrop-contrast: ;
+ --tw-backdrop-grayscale: ;
+ --tw-backdrop-hue-rotate: ;
+ --tw-backdrop-invert: ;
+ --tw-backdrop-opacity: ;
+ --tw-backdrop-saturate: ;
+ --tw-backdrop-sepia: ;
+}
+
+.text-3xl {
+ font-size: 1.875rem;
+ line-height: 2.25rem;
+}
+
+.font-bold {
+ font-weight: 700;
+}
+
+.underline {
+ text-decoration-line: underline;
+}
\ No newline at end of file
diff --git a/src/python programs/chat_with_document.py b/src/python programs/chat_with_document.py
new file mode 100644
index 0000000..03f2e54
--- /dev/null
+++ b/src/python programs/chat_with_document.py
@@ -0,0 +1,65 @@
+from dotenv import load_dotenv
+from langchain.text_splitter import CharacterTextSplitter
+from langchain_community.embeddings import OpenAIEmbeddings
+from langchain_community.vectorstores import FAISS
+from langchain_community.chat_models import ChatOpenAI
+from langchain.memory import ConversationBufferMemory
+from langchain.chains import ConversationalRetrievalChain
+import openai
+import os
+import PyPDF2 # Library to extract text from PDF
+
+load_dotenv()
+
+openai.api_key = os.getenv("OPENAI_API_KEY")
+
+# Function to return chunks of data from the extracted pdf data.
+def get_text_chunks_from_pdf(pdf_path):
+ text = ""
+ with open(pdf_path, "rb") as file:
+ pdf_reader = PyPDF2.PdfFileReader(file)
+ num_pages = pdf_reader.numPages
+ for page_num in range(num_pages):
+ page = pdf_reader.getPage(page_num)
+ text += page.extractText()
+ text_splitter = CharacterTextSplitter(
+ separator="\n",
+ chunk_size=1000,
+ chunk_overlap=200,
+ length_function=len
+ )
+ chunks = text_splitter.split_text(text)
+ return chunks
+
+# Function to get vector data from the text chunks.
+def get_vectorstore(text_chunks):
+ embeddings = OpenAIEmbeddings()
+ vectorstore = FAISS.from_texts(texts=text_chunks, embedding=embeddings)
+ return vectorstore
+
+# Function for the conversation chain.
+def get_conversation_chain(vectorstore):
+ llm = ChatOpenAI()
+ memory = ConversationBufferMemory(
+ memory_key='chat_history', return_messages=True)
+ conversation_chain = ConversationalRetrievalChain.from_llm(
+ llm=llm,
+ retriever=vectorstore.as_retriever(),
+ memory=memory
+ )
+ return conversation_chain
+
+def VectorizationPDF(pdf_path):
+ text_chunks = get_text_chunks_from_pdf(pdf_path)
+ vectorstore = get_vectorstore(text_chunks)
+ conversation = get_conversation_chain(vectorstore)
+ return conversation
+
+def ChatDocument(conversation, user_question):
+ response = conversation({'question': user_question})
+ chat_history = response['chat_history']
+ for i, message in enumerate(chat_history[-2:]):
+ if i % 2 == 0:
+ pass
+ else:
+ return message.content
diff --git a/src/python programs/requirements.txt b/src/python programs/requirements.txt
new file mode 100644
index 0000000..d58c08d
--- /dev/null
+++ b/src/python programs/requirements.txt
@@ -0,0 +1,68 @@
+aiohttp==3.8.6
+aiosignal==1.3.1
+annotated-types==0.6.0
+anyio==3.7.1
+async-timeout==4.0.3
+attrs==23.1.0
+beautifulsoup4==4.12.2
+blinker==1.7.0
+bs4==0.0.1
+certifi==2023.7.22
+charset-normalizer==3.3.2
+click==8.1.7
+colorama==0.4.6
+dataclasses-json==0.6.2
+distro==1.8.0
+faiss-cpu==1.7.4
+Flask==3.0.0
+Flask-Cors==4.0.0
+frozenlist==1.4.0
+futures==3.0.5
+googletrans2==2.3.0
+goslate==1.5.4
+greenlet==3.0.1
+gTTS==2.4.0
+h11==0.14.0
+httpcore==1.0.2
+httpx==0.25.1
+idna==3.4
+iso639==0.1.4
+itsdangerous==2.1.2
+Jinja2==3.1.2
+jsonpatch==1.33
+jsonpointer==2.4
+langchain==0.0.334
+langdetect==1.0.9
+langsmith==0.0.63
+libretranslatepy==2.1.1
+lxml==4.9.3
+MarkupSafe==2.1.3
+marshmallow==3.20.1
+multidict==6.0.4
+mypy-extensions==1.0.0
+numpy==1.26.1
+openai==0.28.0
+opencv-python==4.8.1.78
+packaging==23.2
+Pillow==10.1.0
+pydantic==2.4.2
+pydantic_core==2.10.1
+PyDictionary==2.0.1
+pytesseract==0.3.10
+python-dotenv==1.0.0
+PyYAML==6.0.1
+regex==2023.10.3
+requests==2.31.0
+six==1.16.0
+sniffio==1.3.0
+soupsieve==2.5
+SQLAlchemy==2.0.23
+tenacity==8.2.3
+tiktoken==0.5.1
+tqdm==4.66.1
+translate==3.6.1
+typing-inspect==0.9.0
+typing_extensions==4.8.0
+urllib3==2.0.7
+Werkzeug==3.0.1
+yarl==1.9.2
diff --git a/src/python programs/server.py b/src/python programs/server.py
new file mode 100644
index 0000000..8c5ffc3
--- /dev/null
+++ b/src/python programs/server.py
@@ -0,0 +1,37 @@
+from flask import Flask, request, jsonify
+from flask_cors import CORS
+from chat_with_document import VectorizationPDF, ChatDocument
+from summarize_text import Summarization # Updated import
+import os
+
+app = Flask(__name__)
+CORS(app)
+
+@app.route("/members", methods=['GET'])
+def members():
+ return {"members": ["Member1", "Member2", "Member3"]}
+
+@app.route("/summarize", methods=['POST'])
+def summarize():
+ data = request.get_json()
+
+ pdf_path = data.get('pdf_path')
+ if not os.path.exists(pdf_path):
+ return jsonify({"error": f"File not found: {pdf_path}"}), 404
+ summary = Summarization(pdf_path) # Updated function call
+ return jsonify({"response": summary})
+
+
+@app.route("/docchat", methods=['POST'])
+def document_chat():
+ data = request.get_json()
+ message = data.get('text')
+ pdf_path = data.get('pdf_path')
+ if not os.path.exists(pdf_path):
+ return jsonify({"error": f"File not found: {pdf_path}"}), 404
+ conversation = VectorizationPDF(pdf_path)
+ response = ChatDocument(conversation, message)
+ return jsonify({"response": response})
+
+if __name__ == "__main__":
+ app.run(debug=True)
diff --git a/src/python programs/summarize_text.py b/src/python programs/summarize_text.py
new file mode 100644
index 0000000..d892530
--- /dev/null
+++ b/src/python programs/summarize_text.py
@@ -0,0 +1,58 @@
+from langchain.llms.openai import OpenAI
+from dotenv import load_dotenv
+from langchain.chains.summarize import load_summarize_chain
+from langchain.docstore.document import Document
+from langchain.text_splitter import CharacterTextSplitter
+import os
+from langchain.prompts import PromptTemplate
+import tiktoken
+import PyPDF2 # Library to extract text from PDF
+
+load_dotenv()
+
+def num_tokens_from_string(string, encoding_name):
+ encoding = tiktoken.encoding_for_model(encoding_name)
+ num_tokens = len(encoding.encode(string))
+ return num_tokens
+
+def Summarization(pdf_content, openai_api_key=os.getenv("OPENAI_API_KEY")):
+ # Extract text from the PDF content
+ pdf_text = extract_text_from_pdf(pdf_content)
+
+ # Creating the llm object with the open ai key.
+ llm = OpenAI(temperature=0, openai_api_key=openai_api_key)
+ model_name = "gpt-3.5-turbo"
+ text_splitter = CharacterTextSplitter.from_tiktoken_encoder(model_name=model_name)
+
+ texts = text_splitter.split_text(pdf_text)
+ text = [Document(page_content=t) for t in texts]
+
+ # Creating the prompt template.
+ prompt_template = """Write a concise summary of the following:
+
+ {text}
+ """
+
+ prompt = PromptTemplate(template=prompt_template, input_variables=["text"])
+ combined_text = "\n".join(texts)
+ num_tokens = num_tokens_from_string(combined_text, model_name)
+ gpt_35_turbo_max_tokens = 4097
+ verbose = True
+
+ if num_tokens < gpt_35_turbo_max_tokens:
+ chain = load_summarize_chain(llm, chain_type="stuff", prompt=prompt, verbose=verbose)
+ else:
+ chain = load_summarize_chain(llm, chain_type="map_reduce", map_prompt=prompt, combine_prompt=prompt, verbose=verbose)
+
+ summary = chain.run(text)
+ return summary
+
+def extract_text_from_pdf(pdf_content):
+ # Use PyPDF2 to extract text from the PDF content
+ pdf_text = ""
+ with open(pdf_content, 'rb') as file:
+ pdf_reader = PyPDF2.PdfFileReader(file)
+ for page_num in range(pdf_reader.numPages):
+ page = pdf_reader.getPage(page_num)
+ pdf_text += page.extractText()
+ return pdf_text
diff --git a/statefarmlogo.png b/statefarmlogo.png
new file mode 100644
index 0000000..a4213f4
Binary files /dev/null and b/statefarmlogo.png differ
diff --git a/tailwind.config.js b/tailwind.config.js
new file mode 100644
index 0000000..ffd7c46
--- /dev/null
+++ b/tailwind.config.js
@@ -0,0 +1,9 @@
+/** @type {import('tailwindcss').Config} */
+export default {
+ content: ["./index.html"],
+ theme: {
+ extend: {},
+ },
+ plugins: [],
+}
+
diff --git a/temp.png b/temp.png
new file mode 100644
index 0000000..17845bb
Binary files /dev/null and b/temp.png differ
diff --git a/whitecircle.png b/whitecircle.png
new file mode 100644
index 0000000..8a0b5e3
Binary files /dev/null and b/whitecircle.png differ