nickmuchi commited on
Commit
bfd4202
1 Parent(s): e0d743e

Update functions.py

Browse files
Files changed (1) hide show
  1. functions.py +4 -4
functions.py CHANGED
@@ -43,6 +43,8 @@ time_str = time.strftime("%d%m%Y-%H%M%S")
43
  HTML_WRAPPER = """<div style="overflow-x: auto; border: 1px solid #e6e9ef; border-radius: 0.25rem; padding: 1rem;
44
  margin-bottom: 2.5rem">{}</div> """
45
 
 
 
46
  #Stuff Chain Type Prompt template
47
  output_parser = RegexParser(
48
  regex=r"(.*?)\nScore: (.*)",
@@ -137,8 +139,8 @@ def process_corpus(corpus, _tok, title, _embeddings, chunk_size=200, overlap=50)
137
  docsearch = Pinecone.from_texts(
138
  texts,
139
  _embeddings,
140
- index_name = index_id,
141
- namespace = f'{title}-earnings',
142
  metadatas = [
143
  {'source':i} for i in range(len(texts))]
144
  )
@@ -167,8 +169,6 @@ def embed_text(query,corpus,title,embedding_model,_emb_tok,chain_type='stuff'):
167
 
168
  '''Embed text and generate semantic search scores'''
169
 
170
- index_id = "earnings-embeddings"
171
-
172
  embeddings = gen_embeddings(embedding_model)
173
 
174
  title = title[0]
43
  HTML_WRAPPER = """<div style="overflow-x: auto; border: 1px solid #e6e9ef; border-radius: 0.25rem; padding: 1rem;
44
  margin-bottom: 2.5rem">{}</div> """
45
 
46
+ index_id = "earnings-embeddings"
47
+
48
  #Stuff Chain Type Prompt template
49
  output_parser = RegexParser(
50
  regex=r"(.*?)\nScore: (.*)",
139
  docsearch = Pinecone.from_texts(
140
  texts,
141
  _embeddings,
142
+ index_name = "earnings-embeddings",
143
+ namespace = f'{title.lower()}-earnings',
144
  metadatas = [
145
  {'source':i} for i in range(len(texts))]
146
  )
169
 
170
  '''Embed text and generate semantic search scores'''
171
 
 
 
172
  embeddings = gen_embeddings(embedding_model)
173
 
174
  title = title[0]