mirror of
https://github.com/semantica-agi/semantica.git
synced 2026-08-29 04:26:20 +00:00
Add a Cite Us section to the README with BibTeX citation info, and align it with docs/citation.md (author/organization: Semantica, 2026). Update LICENSE and docs/project-license.md copyright holder to Semantica, and replace the stale Hawksight-AI GitHub org slug with semantica-agi across READMEs, plugin manifests, cookbook notebooks, and GitHub templates.
4.5 KiB
4.5 KiB
In [ ]:
!pip install semantica
In [ ]:
from semantica.embeddings import EmbeddingGenerator
generator = EmbeddingGenerator()
texts = [
"Apple Inc. is a technology company.",
"Microsoft Corporation develops software.",
"Amazon provides cloud services."
]
embeddings = generator.generate_embeddings(texts, data_type="text")
print(f"Generated embeddings for {len(texts)} texts")
print(f"Embeddings shape: {embeddings.shape}")
print(f"First embedding dimension: {len(embeddings[0]) if len(embeddings) > 0 else 'N/A'}")
In [ ]:
from semantica.embeddings import TextEmbedder
text_embedder = TextEmbedder()
text = "Semantic knowledge graphs enable intelligent data processing."
embedding = text_embedder.embed_text(text)
print(f"Generated embedding for text")
print(f"First 5 values: {embedding[:5]}")
In [ ]:
# Initialize with a specific provider and model
embedder = TextEmbedder(method="sentence_transformers", model_name="all-MiniLM-L6-v2")
print(f"Current method: {embedder.get_method()}")
# Switch to FastEmbed dynamically
try:
embedder.set_model(method="fastembed", model_name="BAAI/bge-small-en-v1.5")
print(f"Switched to: {embedder.get_method()}")
print(f"Model Info: {embedder.get_model_info()}")
except ImportError:
print("FastEmbed not installed. Install with: pip install fastembed")