Update app.py
Browse files
app.py
CHANGED
@@ -1,12 +1,18 @@
|
|
1 |
import nltk
|
2 |
nltk.download('punkt')
|
3 |
from nltk.tokenize import sent_tokenize
|
|
|
4 |
|
5 |
# Load the email dataset
|
6 |
# emails = pd.read_csv("/content/drive/MyDrive/Clean/cleaned_data.csv")
|
7 |
|
|
|
|
|
8 |
client = chromadb.PersistentClient(path="./")
|
9 |
|
|
|
|
|
|
|
10 |
# Create a ChromaDB client
|
11 |
# client = chromadb.Client()
|
12 |
# collection = client.create_collection("enron_emails")
|
@@ -27,10 +33,6 @@ model = AutoModelForSeq2SeqLM.from_pretrained("google-t5/t5-small")
|
|
27 |
# Load the tokenizer
|
28 |
tokenizer = AutoTokenizer.from_pretrained("google-t5/t5-small")
|
29 |
|
30 |
-
# Load the ChromaDB collection
|
31 |
-
client = chromadb.Client()
|
32 |
-
collection = client.get_collection("enron_emails")
|
33 |
-
|
34 |
def query_collection(query_text):
|
35 |
try:
|
36 |
# Perform the query
|
|
|
1 |
import nltk
|
2 |
nltk.download('punkt')
|
3 |
from nltk.tokenize import sent_tokenize
|
4 |
+
import chromadb
|
5 |
|
6 |
# Load the email dataset
|
7 |
# emails = pd.read_csv("/content/drive/MyDrive/Clean/cleaned_data.csv")
|
8 |
|
9 |
+
|
10 |
+
client = chromadb.Client()
|
11 |
client = chromadb.PersistentClient(path="./")
|
12 |
|
13 |
+
# Load the ChromaDB collection
|
14 |
+
collection = client.get_collection("enron_emails")
|
15 |
+
|
16 |
# Create a ChromaDB client
|
17 |
# client = chromadb.Client()
|
18 |
# collection = client.create_collection("enron_emails")
|
|
|
33 |
# Load the tokenizer
|
34 |
tokenizer = AutoTokenizer.from_pretrained("google-t5/t5-small")
|
35 |
|
|
|
|
|
|
|
|
|
36 |
def query_collection(query_text):
|
37 |
try:
|
38 |
# Perform the query
|