spatialrust_semantic/
entity.rs1use spatialrust_math::Vec3;
4
5use crate::Embedding;
6
7#[derive(Clone, Debug, PartialEq, Eq, Hash)]
9pub struct EntityId(pub String);
10
11impl EntityId {
12 #[must_use]
14 pub fn new(value: impl Into<String>) -> Self {
15 Self(value.into())
16 }
17}
18
19#[derive(Clone, Debug, PartialEq)]
21pub struct OpenVocabLabel {
22 pub text: String,
24 pub confidence: f32,
26}
27
28#[derive(Clone, Debug, PartialEq)]
30pub struct SemanticEntity {
31 pub id: EntityId,
33 pub centroid: Option<Vec3<f32>>,
35 pub labels: Vec<OpenVocabLabel>,
37 pub embedding: Option<Embedding>,
39}