docs: update earnings call analysis notebook

This commit is contained in:
KaifAhmad1
2026-01-18 23:53:07 +05:30
parent 0eabfb861e
commit d9117b7c2f
@@ -779,12 +779,10 @@
"connectivity = graph_analyzer.analyze_connectivity(knowledge_graph)\n",
"metrics = graph_analyzer.compute_metrics(knowledge_graph)\n",
"\n",
"top_entities = centrality.get(\"rankings\", [])[:5]\n",
"num_communities = len(communities.get(\"communities\", []))\n",
"\n",
"print(\"Graph analysis completed\")\n",
"print(\"Communities:\", num_communities)\n",
"print(\"Top entities:\", len(top_entities))\n"
"print(\"Communities:\", num_communities)"
]
},
{
@@ -917,16 +915,23 @@
"metadata": {},
"outputs": [],
"source": [
"from semantica.vector_store import VectorStore\n",
"from semantica.context import ContextRetriever\n",
"from semantica.vector_store import VectorStore \n",
"from semantica.context import ContextRetriever \n",
"import numpy as np\n",
"\n",
"vector_store = VectorStore(backend=\"faiss\")\n",
"# Initialize vector store (dimension should match your embedder; default is 768)\n",
"vector_store = VectorStore(backend=\"faiss\", dimension=768)\n",
"\n",
"vector_store.add(\n",
" texts=[parsed_doc[\"full_text\"]],\n",
"# 1) Embed the full transcript\n",
"embedding = vector_store.embed(parsed_doc[\"full_text\"])\n",
"\n",
"# 2) Store the embedding + metadata\n",
"vector_store.store(\n",
" vectors=[embedding],\n",
" metadata=[{\"source\": \"earnings_call\", \"type\": \"transcript\"}],\n",
")\n",
"\n",
"# 3) Configure the context retriever as before\n",
"context_retriever = ContextRetriever(\n",
" knowledge_graph=knowledge_graph,\n",
" vector_store=vector_store,\n",
@@ -952,7 +957,7 @@
"\n",
"print(\"Hybrid GraphRAG configured\")\n",
"print(\"Queries processed:\", len(queries))\n",
"print(\"Sample results:\", len(retrieved_contexts[0]) if retrieved_contexts else 0)\n"
"print(\"Sample results:\", len(retrieved_contexts[0]) if retrieved_contexts else 0)"
]
},
{