(node: Dict[str, Any])
| 121 | return np.array([], dtype=np.float32) |
| 122 | if isinstance(blob, memoryview): |
| 123 | blob = blob.tobytes() |
| 124 | array = np.frombuffer(blob, dtype=np.float32) |
| 125 | norm = float(np.linalg.norm(array)) |
| 126 | if norm > 0: |
| 127 | array = array / norm |
| 128 | return array |
| 129 | |
| 130 | |
| 131 | def _node_embedding_text(node: Dict[str, Any]) -> str: |
| 132 | return "\n".join( |
| 133 | part |
| 134 | for part in ( |
| 135 | str(node.get("title") or ""), |
no test coverage detected