mirror of
				https://github.com/deepset-ai/haystack.git
				synced 2025-11-04 03:39:31 +00:00 
			
		
		
		
	Update Tutorial 4
This commit is contained in:
		
							parent
							
								
									355be293b6
								
							
						
					
					
						commit
						5b1be233d0
					
				@ -186,6 +186,7 @@
 | 
				
			|||||||
    "# Get embeddings for our questions from the FAQs\n",
 | 
					    "# Get embeddings for our questions from the FAQs\n",
 | 
				
			||||||
    "questions = list(df[\"question\"].values)\n",
 | 
					    "questions = list(df[\"question\"].values)\n",
 | 
				
			||||||
    "df[\"question_emb\"] = retriever.embed_queries(texts=questions)\n",
 | 
					    "df[\"question_emb\"] = retriever.embed_queries(texts=questions)\n",
 | 
				
			||||||
 | 
					    "df[\"question_emb\"] = df[\"question_emb\"].apply(list) # convert from numpy to list for ES indexing\n",
 | 
				
			||||||
    "\n",
 | 
					    "\n",
 | 
				
			||||||
    "# Convert Dataframe to list of dicts and index them in our DocumentStore\n",
 | 
					    "# Convert Dataframe to list of dicts and index them in our DocumentStore\n",
 | 
				
			||||||
    "docs_to_index = df.to_dict(orient=\"records\")\n",
 | 
					    "docs_to_index = df.to_dict(orient=\"records\")\n",
 | 
				
			||||||
 | 
				
			|||||||
@ -68,6 +68,7 @@ print(df.head())
 | 
				
			|||||||
# Get embeddings for our questions from the FAQs
 | 
					# Get embeddings for our questions from the FAQs
 | 
				
			||||||
questions = list(df["question"].values)
 | 
					questions = list(df["question"].values)
 | 
				
			||||||
df["question_emb"] = retriever.embed_queries(texts=questions)
 | 
					df["question_emb"] = retriever.embed_queries(texts=questions)
 | 
				
			||||||
 | 
					df["question_emb"] = df["question_emb"].apply(list) # convert from numpy to list for ES indexing
 | 
				
			||||||
 | 
					
 | 
				
			||||||
# Convert Dataframe to list of dicts and index them in our DocumentStore
 | 
					# Convert Dataframe to list of dicts and index them in our DocumentStore
 | 
				
			||||||
docs_to_index = df.to_dict(orient="records")
 | 
					docs_to_index = df.to_dict(orient="records")
 | 
				
			||||||
 | 
				
			|||||||
		Loading…
	
	
			
			x
			
			
		
	
		Reference in New Issue
	
	Block a user