redo noembeddingphrase to return an empty embedding
This commit is contained in:
1 parent
6d6ba89354
commit
84cd06e8e8
2 files changed
+7
-1
No files matched your search
@@ -15,9 +15,10 @@ class Lexeme(ABC):
|
||||
pass
|
||||
|
||||
@property
|
||||
@abstractmethod
|
||||
def embedding(self) -> Embedding:
|
||||
"""Embedding(s) associated with the lexeme."""
|
||||
raise NotImplementedError("Embeddings are not supported") #added to allow for NoEmbeddingPhrase
|
||||
pass
|
||||
|
||||
@classmethod
|
||||
@abstractmethod
|
||||
|
||||
@@ -35,6 +35,11 @@ class NoEmbeddingPhrase(Lexeme):
|
||||
@property
|
||||
def content(self) -> str:
|
||||
return self._content
|
||||
|
||||
@property
|
||||
def embedding(self) -> Embedding:
|
||||
return self._embedding
|
||||
|
||||
@classmethod
|
||||
def from_dict(cls, data: dict) -> "Phrase":
|
||||
return cls(
|
||||
|
||||
Reference in new issue
Block a user