Entz commited on
Commit
f6da3c7
1 Parent(s): b27115b

Upload 11 files

Browse files
.dockerignore ADDED
@@ -0,0 +1,7 @@
 
 
 
 
 
 
 
 
1
+ __pycache__
2
+ *.pyc
3
+ *.pyo
4
+ *.pyd
5
+ *.db
6
+ .DS_Store
7
+ .env
app.py ADDED
@@ -0,0 +1,111 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import streamlit as st
2
+ import pandas as pd
3
+ import sqlite3
4
+ from llama_index.core import StorageContext, load_index_from_storage
5
+ from llama_index.llms.ollama import Ollama
6
+ from llama_index.embeddings.huggingface import HuggingFaceEmbedding
7
+ from llama_index.core import PromptTemplate
8
+ import os
9
+
10
+
11
+ version = 2.3
12
+
13
+ # Initialize the SQLite3 database
14
+ conn = sqlite3.connect('qa.db')
15
+ c = conn.cursor()
16
+ # Update the table creation to include the version column
17
+ c.execute('CREATE TABLE IF NOT EXISTS qa (question TEXT, answer TEXT, version REAL)')
18
+ conn.commit()
19
+
20
+ # Read the LLM Model Description from a file
21
+ def read_description_from_file(file_path):
22
+ with open(file_path, 'r') as file:
23
+ return file.read()
24
+
25
+ # Define the folder containing the saved index
26
+ INDEX_OUTPUT_PATH = "./output_index"
27
+
28
+ # Ensure the output directory exists
29
+ if not os.path.exists(INDEX_OUTPUT_PATH):
30
+ raise ValueError(f"Index directory {INDEX_OUTPUT_PATH} does not exist")
31
+
32
+ # Setup LLM and embedding model
33
+ llm = Ollama(model="llama3", request_timeout=120.0)
34
+ embed_model = HuggingFaceEmbedding(model_name="BAAI/bge-large-en-v1.5", trust_remote_code=True)
35
+
36
+ # To load the index later, set up the storage context
37
+ storage_context = StorageContext.from_defaults(persist_dir=INDEX_OUTPUT_PATH)
38
+ loaded_index = load_index_from_storage(embed_model=embed_model, storage_context=storage_context)
39
+
40
+ # Define a query engine (assuming it needs the LLM and embedding model)
41
+ query_engine = loaded_index.as_query_engine(llm=llm, embed_model=embed_model)
42
+
43
+ # Customise prompt template
44
+ # Read the prompt template from a file
45
+ qa_prompt_tmpl_str = read_description_from_file("tab2_pe.txt")
46
+ qa_prompt_tmpl = PromptTemplate(qa_prompt_tmpl_str)
47
+
48
+ query_engine.update_prompts(
49
+ {"response_synthesizer:text_qa_template": qa_prompt_tmpl}
50
+ )
51
+
52
+ # Save the question and answer to the SQLite3 database
53
+ def save_to_db(question, answer, version):
54
+ c.execute('INSERT INTO qa (question, answer, version) VALUES (?, ?, ?)', (question, answer, version))
55
+ conn.commit()
56
+
57
+ # Fetch all data from the SQLite3 database
58
+ def fetch_from_db():
59
+ c.execute('SELECT * FROM qa')
60
+ return c.fetchall()
61
+
62
+ def main():
63
+ st.title("How Much AI Can Assist Our Email Replying System Of Our Council?")
64
+
65
+ tab1, tab2, tab3 = st.tabs(["LLM Model Description", "Ask a Question", "View Q&A History"])
66
+
67
+ with tab1:
68
+ st.subheader("LLM Model Description")
69
+ description = read_description_from_file("tab1_intro.txt")
70
+ st.write(description)
71
+
72
+ with tab2:
73
+ st.subheader("Ask a Question (Please try to focus on council tax)")
74
+ question = st.text_input("Enter your question:")
75
+ if st.button("Get Answer"):
76
+ if question:
77
+ try:
78
+ response = query_engine.query(question)
79
+
80
+ # Try to extract the generated text
81
+ try:
82
+ # Extract the text from the response object (assuming it has a `text` attribute or method)
83
+ if hasattr(response, 'text'):
84
+ answer = response.text
85
+ else:
86
+ answer = str(response)
87
+
88
+ except AttributeError as e:
89
+ st.error(f"Error extracting text from response: {e}")
90
+ answer = "Sorry, could not generate an answer."
91
+
92
+ st.write(f"**Answer:** {answer}")
93
+
94
+ # Save question and answer to database
95
+ save_to_db(question, answer, version)
96
+ except Exception as e:
97
+ st.error(f"An error occurred: {e}")
98
+ else:
99
+ st.warning("Please enter a question")
100
+
101
+ with tab3:
102
+ st.subheader("View Q&A History")
103
+ qa_data = fetch_from_db()
104
+ if qa_data:
105
+ df = pd.DataFrame(qa_data, columns=["Question", "Answer", "Version"])
106
+ st.dataframe(df)
107
+ else:
108
+ st.write("No data available")
109
+
110
+ if __name__ == "__main__":
111
+ main()
output_index/default__vector_store.json ADDED
The diff for this file is too large to render. See raw diff
 
output_index/docstore.json ADDED
The diff for this file is too large to render. See raw diff
 
output_index/graph_store.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"graph_dict": {}}
output_index/image__vector_store.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"embedding_dict": {}, "text_id_to_ref_doc_id": {}, "metadata_dict": {}}
output_index/index_store.json ADDED
@@ -0,0 +1 @@
 
 
1
+ {"index_store/data": {"c469b08f-0c42-4ba0-b0d7-b6eaa1ee6183": {"__type__": "vector_store", "__data__": "{\"index_id\": \"c469b08f-0c42-4ba0-b0d7-b6eaa1ee6183\", \"summary\": null, \"nodes_dict\": {\"33c53565-9dfb-487f-9a97-73696de5a779\": \"33c53565-9dfb-487f-9a97-73696de5a779\", \"e774e6fa-49a4-499b-9542-6e5dc0865e87\": \"e774e6fa-49a4-499b-9542-6e5dc0865e87\", \"821f2b8b-b194-4d42-8712-61ddc34338cc\": \"821f2b8b-b194-4d42-8712-61ddc34338cc\", \"165cc8a2-1ee4-4a4e-bc8d-8aad10f3b729\": \"165cc8a2-1ee4-4a4e-bc8d-8aad10f3b729\", \"d3c8bc5a-0c7d-49c6-b5cd-cc3a3c26704a\": \"d3c8bc5a-0c7d-49c6-b5cd-cc3a3c26704a\", \"48b0e0e8-d11a-4f68-80be-a90086388ef4\": \"48b0e0e8-d11a-4f68-80be-a90086388ef4\", \"84247f5d-f4fa-4cf7-b0b4-9a67f5fb7549\": \"84247f5d-f4fa-4cf7-b0b4-9a67f5fb7549\", \"51dd598b-993f-4375-9d43-7bdd41c10fcf\": \"51dd598b-993f-4375-9d43-7bdd41c10fcf\", \"a51f254c-0cd5-45aa-b56a-dd2845d7beb1\": \"a51f254c-0cd5-45aa-b56a-dd2845d7beb1\", \"d79ee6c8-ef73-4f0e-a8a4-3c4b227ee4cd\": \"d79ee6c8-ef73-4f0e-a8a4-3c4b227ee4cd\", \"6e6c65cb-7157-446e-b284-964a96348f90\": \"6e6c65cb-7157-446e-b284-964a96348f90\", \"301291ad-5944-45a7-aba9-af0d3d456cf8\": \"301291ad-5944-45a7-aba9-af0d3d456cf8\", \"98b29000-937a-4ac7-8169-d25e85eab9f6\": \"98b29000-937a-4ac7-8169-d25e85eab9f6\", \"7bc5489f-d3e3-45d0-9a74-bededf8efe16\": \"7bc5489f-d3e3-45d0-9a74-bededf8efe16\", \"f2c47574-6905-4172-870d-b25c674b37c6\": \"f2c47574-6905-4172-870d-b25c674b37c6\", \"67535679-f044-456d-9572-f7c455ae466b\": \"67535679-f044-456d-9572-f7c455ae466b\", \"503f7f9d-ea77-4c18-b13c-96765324dc6d\": \"503f7f9d-ea77-4c18-b13c-96765324dc6d\", \"628bdb9a-651d-457f-a4b8-f9e26a1a9b0e\": \"628bdb9a-651d-457f-a4b8-f9e26a1a9b0e\", \"1f0382d9-f7c2-40a5-9c4e-294cea8a22a0\": \"1f0382d9-f7c2-40a5-9c4e-294cea8a22a0\", \"c4e0d291-2dff-45a5-a98d-d4a8b370d91d\": \"c4e0d291-2dff-45a5-a98d-d4a8b370d91d\", \"8f64fe50-20d7-4814-b2b6-cac8f3eb06f5\": \"8f64fe50-20d7-4814-b2b6-cac8f3eb06f5\", \"a4af3e88-d8c5-46e6-b909-89eff47c7751\": \"a4af3e88-d8c5-46e6-b909-89eff47c7751\", \"cce984c0-ecb0-4587-957b-622c0157f9f9\": \"cce984c0-ecb0-4587-957b-622c0157f9f9\", \"20d941fe-af25-4b3b-aa0c-1b8cd180a816\": \"20d941fe-af25-4b3b-aa0c-1b8cd180a816\", \"fee4a597-2682-498e-a624-42cf791aeb7c\": \"fee4a597-2682-498e-a624-42cf791aeb7c\", \"3c83c75e-b9b7-4307-83b6-2baea806998a\": \"3c83c75e-b9b7-4307-83b6-2baea806998a\", \"7d7551cf-178a-44cf-9b28-d4c700f6c613\": \"7d7551cf-178a-44cf-9b28-d4c700f6c613\", \"99679d23-c430-4dc8-a76b-4cee4b8f888e\": \"99679d23-c430-4dc8-a76b-4cee4b8f888e\", \"ba5ae8ba-10fc-4e4f-a89c-70cbf7f0dab4\": \"ba5ae8ba-10fc-4e4f-a89c-70cbf7f0dab4\", \"649fa870-cfcf-46aa-bda0-b649608da03f\": \"649fa870-cfcf-46aa-bda0-b649608da03f\", \"021df5cb-b39e-4117-96cc-ca998faac5db\": \"021df5cb-b39e-4117-96cc-ca998faac5db\", \"22ec0451-b910-4905-85e3-84b163953174\": \"22ec0451-b910-4905-85e3-84b163953174\", \"621e9e2e-5ae8-4028-ac2b-d514a45cdd05\": \"621e9e2e-5ae8-4028-ac2b-d514a45cdd05\", \"4005b810-0192-4975-964f-a60772870698\": \"4005b810-0192-4975-964f-a60772870698\", \"da26efd1-b9d5-4237-91e9-9958a083f03d\": \"da26efd1-b9d5-4237-91e9-9958a083f03d\", \"4e788443-05ca-4b66-8691-ade4ac89cbd5\": \"4e788443-05ca-4b66-8691-ade4ac89cbd5\", \"292884c7-a43d-4123-9612-cea83b0dee85\": \"292884c7-a43d-4123-9612-cea83b0dee85\", \"aa728148-b913-4a6c-a55d-46c64910d142\": \"aa728148-b913-4a6c-a55d-46c64910d142\", \"f241618c-a05b-40a5-aaa9-dff177fc284c\": \"f241618c-a05b-40a5-aaa9-dff177fc284c\", \"4bf13dbc-3550-4c01-993e-f95d54edcd14\": \"4bf13dbc-3550-4c01-993e-f95d54edcd14\", \"ef5ea103-9904-4e31-93db-ce2ca4682808\": \"ef5ea103-9904-4e31-93db-ce2ca4682808\", \"02607be0-cc97-4ba2-ad6a-eb4cb0219c2a\": \"02607be0-cc97-4ba2-ad6a-eb4cb0219c2a\", \"39f2bb82-063f-4545-b8e1-873fb28fc367\": \"39f2bb82-063f-4545-b8e1-873fb28fc367\", \"fe521397-2a9c-42ca-b71a-e06bbb472b4b\": \"fe521397-2a9c-42ca-b71a-e06bbb472b4b\", \"8368fef5-d28e-4054-9996-bd83e690cabd\": \"8368fef5-d28e-4054-9996-bd83e690cabd\", \"561c2ec5-17d6-40d7-8505-c69ca1fdd235\": \"561c2ec5-17d6-40d7-8505-c69ca1fdd235\", \"5cb97913-abb4-4ed0-b98c-253e4a22be8f\": \"5cb97913-abb4-4ed0-b98c-253e4a22be8f\", \"a572f15c-c637-4a52-9015-29f5fa83a916\": \"a572f15c-c637-4a52-9015-29f5fa83a916\", \"42ea3e6f-5b4c-42aa-b627-4f42f3885609\": \"42ea3e6f-5b4c-42aa-b627-4f42f3885609\", \"a3896ab4-b079-4ef8-82b7-0080c7027b41\": \"a3896ab4-b079-4ef8-82b7-0080c7027b41\", \"c0befefc-9092-4e4d-9ac9-d419c043d14f\": \"c0befefc-9092-4e4d-9ac9-d419c043d14f\", \"b9a8a001-8734-4f02-972c-951a284d5162\": \"b9a8a001-8734-4f02-972c-951a284d5162\", \"b36f86bc-59b3-4427-874b-c67776a26ef2\": \"b36f86bc-59b3-4427-874b-c67776a26ef2\", \"1ce8134e-05e4-4395-90b8-5c571c72cb24\": \"1ce8134e-05e4-4395-90b8-5c571c72cb24\", \"eae854f5-1562-4d05-b3d8-12fb5ddc2b36\": \"eae854f5-1562-4d05-b3d8-12fb5ddc2b36\", \"30bfb543-29a5-44fb-ae8f-512496e2a066\": \"30bfb543-29a5-44fb-ae8f-512496e2a066\", \"77d321f6-eb4c-4ae9-9354-b5eb384586f0\": \"77d321f6-eb4c-4ae9-9354-b5eb384586f0\", \"a4ff45e3-526d-4676-bb8e-87bef94fab00\": \"a4ff45e3-526d-4676-bb8e-87bef94fab00\", \"fbcf4f30-395d-48c5-966f-85710f7d52c3\": \"fbcf4f30-395d-48c5-966f-85710f7d52c3\", \"dc9eb2c1-2105-4236-bb6c-cec3088ddf07\": \"dc9eb2c1-2105-4236-bb6c-cec3088ddf07\", \"dd6491de-2eab-4a29-9306-972ed40209f6\": \"dd6491de-2eab-4a29-9306-972ed40209f6\", \"4213d7d3-0cd9-4c6a-be77-0e6d787161b9\": \"4213d7d3-0cd9-4c6a-be77-0e6d787161b9\", \"42275c7a-0590-45d3-829b-6c415ccfc3fd\": \"42275c7a-0590-45d3-829b-6c415ccfc3fd\", \"f4c1b4e6-e384-419c-8e17-7270217efdf5\": \"f4c1b4e6-e384-419c-8e17-7270217efdf5\", \"74323627-81cc-41ea-9798-d3902c9a34ae\": \"74323627-81cc-41ea-9798-d3902c9a34ae\", \"8f051a42-e2cf-49e9-bdd3-a48617ddd0e9\": \"8f051a42-e2cf-49e9-bdd3-a48617ddd0e9\", \"267f80cd-16c7-4cce-84c0-789f524feb55\": \"267f80cd-16c7-4cce-84c0-789f524feb55\", \"d9bb2d84-c4dd-4268-916f-37e5e9813dee\": \"d9bb2d84-c4dd-4268-916f-37e5e9813dee\", \"aa2ea4f8-41e2-4a05-9b4e-1636d187bc31\": \"aa2ea4f8-41e2-4a05-9b4e-1636d187bc31\", \"79245c24-fc28-47a1-a909-ab71dd833c67\": \"79245c24-fc28-47a1-a909-ab71dd833c67\", \"effb1903-dfcd-4ac6-8cd8-3eedfc9068b3\": \"effb1903-dfcd-4ac6-8cd8-3eedfc9068b3\", \"184aaf77-b9cf-4c84-a1b9-c50f78c61bcb\": \"184aaf77-b9cf-4c84-a1b9-c50f78c61bcb\", \"19c3c4e2-7dba-479d-b755-b636bc2606f3\": \"19c3c4e2-7dba-479d-b755-b636bc2606f3\", \"58e0464c-f0d0-441c-b113-5d737381aa9c\": \"58e0464c-f0d0-441c-b113-5d737381aa9c\", \"dcb1877e-8402-4e9c-ba16-320f080f677e\": \"dcb1877e-8402-4e9c-ba16-320f080f677e\", \"c206bfc5-bf38-4fb0-bfe3-65e451b8f5e2\": \"c206bfc5-bf38-4fb0-bfe3-65e451b8f5e2\", \"222a1de1-d0ac-4bd2-90bb-021133cff564\": \"222a1de1-d0ac-4bd2-90bb-021133cff564\", \"61c020c9-11c2-4072-a473-d705b04c3520\": \"61c020c9-11c2-4072-a473-d705b04c3520\", \"f40082a8-51fe-417c-a9e7-f1c89ef14abe\": \"f40082a8-51fe-417c-a9e7-f1c89ef14abe\", \"a84f53ed-4787-4dda-85b5-b366ecf8a4d9\": \"a84f53ed-4787-4dda-85b5-b366ecf8a4d9\", \"489391f7-6fff-471a-a362-f42f21a56a25\": \"489391f7-6fff-471a-a362-f42f21a56a25\", \"a48e621f-b6f7-4b47-8384-4c09a9e4525e\": \"a48e621f-b6f7-4b47-8384-4c09a9e4525e\", \"3029cf73-e67a-43ab-b886-ee50185e625c\": \"3029cf73-e67a-43ab-b886-ee50185e625c\", \"dbc9d08e-8d1a-4bac-af85-c80f91fc711a\": \"dbc9d08e-8d1a-4bac-af85-c80f91fc711a\", \"77520b38-8c25-40f3-85df-6cc6cd958f6d\": \"77520b38-8c25-40f3-85df-6cc6cd958f6d\", \"0095107a-9fc2-4535-9347-fcfa65866a8e\": \"0095107a-9fc2-4535-9347-fcfa65866a8e\", \"3c69ea5f-3da8-448c-b0b2-8d8d3e65423e\": \"3c69ea5f-3da8-448c-b0b2-8d8d3e65423e\", \"ca216c30-1adc-4b16-84b6-d5d3331fc170\": \"ca216c30-1adc-4b16-84b6-d5d3331fc170\", \"e9ca83c1-81db-4eb4-b54e-d878702adcb6\": \"e9ca83c1-81db-4eb4-b54e-d878702adcb6\", \"f0d4cb40-32de-4506-b2a1-e52726e6c4ed\": \"f0d4cb40-32de-4506-b2a1-e52726e6c4ed\", \"862bd039-b20e-439b-a504-001d57fe0828\": \"862bd039-b20e-439b-a504-001d57fe0828\", \"a1138914-ff27-432a-98fa-6b0bd86ff9ab\": \"a1138914-ff27-432a-98fa-6b0bd86ff9ab\", \"257f8d61-c09a-41a2-af9b-66ca0cbf9cad\": \"257f8d61-c09a-41a2-af9b-66ca0cbf9cad\", \"b9d2ecae-8df9-41f1-8ae8-2f7510ef8766\": \"b9d2ecae-8df9-41f1-8ae8-2f7510ef8766\", \"25cf167b-9786-4248-8d41-4856e97d40cd\": \"25cf167b-9786-4248-8d41-4856e97d40cd\", \"56ffbc47-43f7-4554-93f8-e42f1b5d2b5c\": \"56ffbc47-43f7-4554-93f8-e42f1b5d2b5c\", \"f2204644-4e6a-490b-bbfa-8b98a26cea8a\": \"f2204644-4e6a-490b-bbfa-8b98a26cea8a\", \"d3226c5e-f833-435d-8e68-e6e1c798ea10\": \"d3226c5e-f833-435d-8e68-e6e1c798ea10\", \"7b689d9a-d684-4b0b-954c-72c1ffa2cc05\": \"7b689d9a-d684-4b0b-954c-72c1ffa2cc05\", \"5bc48f85-08b3-468b-ac4a-71c972349c88\": \"5bc48f85-08b3-468b-ac4a-71c972349c88\", \"933ed1cc-2645-4c07-91d3-5a7b05323f3a\": \"933ed1cc-2645-4c07-91d3-5a7b05323f3a\", \"92af32a5-ac98-410d-99b4-ed98bb84b69f\": \"92af32a5-ac98-410d-99b4-ed98bb84b69f\", \"71e48abc-955d-48af-a7c8-b2562ae814f4\": \"71e48abc-955d-48af-a7c8-b2562ae814f4\", \"55248f7e-ca84-4888-864e-b84d13afa998\": \"55248f7e-ca84-4888-864e-b84d13afa998\", \"ccea5abd-ee3f-4468-b123-34f1f226bbd9\": \"ccea5abd-ee3f-4468-b123-34f1f226bbd9\", \"c66b9627-daa9-4901-b873-37e14a35ee59\": \"c66b9627-daa9-4901-b873-37e14a35ee59\", \"3dfba39c-538b-4af1-8946-686c796012ce\": \"3dfba39c-538b-4af1-8946-686c796012ce\", \"334c51bd-a713-49df-84c6-abe424c39c1f\": \"334c51bd-a713-49df-84c6-abe424c39c1f\", \"2d6e49ed-bf60-4cb7-a067-16fe41a0aff8\": \"2d6e49ed-bf60-4cb7-a067-16fe41a0aff8\", \"a626bc77-7f5c-4b73-b459-9827887b1b41\": \"a626bc77-7f5c-4b73-b459-9827887b1b41\", \"eff8dda4-91c7-4a2a-aae4-97376ceadb61\": \"eff8dda4-91c7-4a2a-aae4-97376ceadb61\", \"cc54504d-a46e-46ed-a3aa-41fe563c23c5\": \"cc54504d-a46e-46ed-a3aa-41fe563c23c5\", \"ff9f932f-9c86-4ec5-ade8-05817b948468\": \"ff9f932f-9c86-4ec5-ade8-05817b948468\", \"e5986065-886d-4745-9d73-051f6d24031b\": \"e5986065-886d-4745-9d73-051f6d24031b\", \"bced88b7-d1da-46b4-98e8-fe398c414227\": \"bced88b7-d1da-46b4-98e8-fe398c414227\", \"d514b0d5-268b-4ad8-b604-00006edda46d\": \"d514b0d5-268b-4ad8-b604-00006edda46d\", \"7a42b8ce-5a59-4906-8cdb-556353d7b1c5\": \"7a42b8ce-5a59-4906-8cdb-556353d7b1c5\"}, \"doc_id_dict\": {}, \"embeddings_dict\": {}}"}}}
qa.db ADDED
Binary file (32.8 kB). View file
 
requirements.txt ADDED
@@ -0,0 +1,6 @@
 
 
 
 
 
 
 
1
+ streamlit==1.36.0
2
+ pandas==2.2.2
3
+ llama_index==0.10.50
4
+ transformers==4.41.2
5
+ llama_index.llms.ollama
6
+ llama_index.embeddings.huggingface
tab1_intro.txt ADDED
@@ -0,0 +1,37 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+
2
+ **Welcome to my pilot project!** This initiative is designed to explore and evaluate the capabilities of the local Llama 3 model in understanding and providing information about Wandsworth Council, specifically focusing on council tax queries. This application leverages the RAG framework and Prompt Engineering to handle question and answer tasks, similar to the recent [GOV.UK Chat](https://insidegovuk.blog.gov.uk/2024/01/18/the-findings-of-our-first-generative-ai-experiment-gov-uk-chat/) experiment.
3
+
4
+ ### What is the Llama 3 8B Model?
5
+ The Llama 3 model is an advanced language model engineered to comprehend and generate human-like text. This model is part of the latest generation of AI, trained on a diverse dataset, enabling it to deliver accurate and insightful responses to a broad spectrum of questions.
6
+
7
+ ### How Does It Work?
8
+ **Ask a Question:** Users can input their questions regarding Wandsworth Council's council tax in the "Ask a Question" tab. The Llama 3 model will process the query and generate a relevant response based on its extensive training data.
9
+
10
+ **View Q&A History:** All user queries and corresponding answers are stored in a database, allowing us to analyze the model's performance over time. Users can view the history of questions and answers in the "View Q&A History" tab. Please DO NO personal identifiable information (PII). Please just make up a name if you want to include it into your queries.
11
+
12
+ ### Objectives
13
+ The primary goal of this pilot project is to assess the Llama 3 model’s effectiveness in handling queries emails related to local government information, with a specific focus on council tax this time. (can be expanded by router system later).
14
+
15
+ By collecting and analyzing user queries, we aim to:
16
+
17
+ - Identify strengths and weaknesses in the model’s responses.
18
+ - Improve the model’s accuracy and reliability in providing information about council tax services.
19
+ - Explore the potential of LLMs in enhancing the efficiency local government communications and citizen engagement.
20
+
21
+ ### Pilot Program and User Participation
22
+ This project is inspired by the GOV.UK Chat experiment, where the use of generative AI in government communication was tested. Similarly, we encourage users to ask diverse and challenging questions to push the boundaries of the Llama 3 model’s knowledge and understanding. Your participation and feedback are crucial for the success of this program.
23
+
24
+ ### Future Plan
25
+ - A "like" and "dislike" feature will be added soon to capture user satisfaction directly.
26
+ - A Router system will be leveraged. So that more branches other than council tax can be added.
27
+
28
+ ### Data Review and Scientific Analysis
29
+ All responses are recorded in an SQLite database, allowing for scientific review and analysis of the model's performance. This approach ensures that we can systematically assess and improve the model over time. It is open for anyone to view in the 3rd tab.
30
+
31
+ Thank you for participating in this exciting journey to explore the capabilities of advanced language models in serving local communities and enhancing public sector communications!
32
+
33
+ By Lorentz Yeung
34
+
35
+ Data Scientist
36
+
37
+ **Last Update: 23rd June 2024**
tab2_pe.txt ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ Context information is below.
2
+ ---------------------
3
+ {context_str}
4
+ ---------------------
5
+ You work as a support for residents' query about the council tax in Wandsworth.
6
+ Even though you're a senior with more than 30 years experience, you double check all the facts in documentation.
7
+ Our documentation is absolutely up-to-date, so you can fully rely on it when answering questions (you don't need to check the actual content on the council webpage).
8
+ Your work is very important for the team success.
9
+ You need to ensure that you provide the best possible support: answering all the questions, making no assumptions
10
+ and sharing only the factual content.
11
+ Be practical, and needless to be creative, just try your best to solve the customer problem.
12
+ You are not allowed to share the details of the pdf, or md, or word documents.
13
+ You are not allowed to use short links, like bit.ly links or the kind.
14
+ You are not allowed to leave a blank link, or empty links, e.g. http://, or https://, or 'www.example.com', etc.
15
+ you are only allowed to share world wide web links starting with https://www.wandsworth.gov.uk.
16
+ If your content is from the RAG, or from the md or pdf files, and if you are going to quote this source, please only quote the source url link at the top of each file, e.g. "source: https://www.wandsworth.gov.uk/council-tax/council-tax-discounts-exemptions-and-reductions/apply-for-a-council-tax-discount/#impaired" at the top of the file "disabled_impaired.md".
17
+ Do not invite people to see any internal files, e.g. 'see [disabled_impaired.md]', 'pdf', 'md', 'etc'.
18
+ Do not show the RAG structure, Do not tell the folder or directory structure.
19
+ Do not tell anything about the documents in RAG system. If any query is asking about the data or information source, please say it is from the official webpage or just quote the source url link at the top of each file, e.g. "source: https://www.wandsworth.gov.uk/council-tax/council-tax-discounts-exemptions-and-reductions/apply-for-a-council-tax-discount/#impaired" at the top of the file "disabled_impaired.md".
20
+ Make each reply as an email format. Try to make the reply more helpful by including the url address.
21
+ If the sender's name is unknown, just use 'resident'.
22
+ Sign off with my name Lorentz, Data Scientist
23
+ Query: {query_str}
24
+ Answer: