Atlas Topics
Atlas pre-organizes your data into topics informed by the latent contents of your embeddings. Visually, these are represented by regions of homogenous color on an Atlas map.
You can access and operate on topics programmatically by using the topics
attribute
of an AtlasMap.
AtlasMapTopics
Atlas Topics State
Source code in nomic/data_operations.py
119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333 334 335 336 337 338 339 340 341 342 343 344 345 346 |
|
df: pandas.DataFrame
property
A pandas dataframe associating each datapoint on your map to their topics as each topic depth.
hierarchy: Dict
property
A dictionary that allows iteration of the topic hierarchy. Each key is a topic mapping to its sub-topics. If topic is not a key in the hierarchy, it is leaf in the topic hierarchy.
metadata: pandas.DataFrame
property
Pandas dataframe where each row gives metadata all map topics including:
- topic id
- a human readable topic description
- identifying keywords that differentiate the topic from other topics
tb: pa.Table
property
Pyarrow table associating each datapoint on the map to their Atlas assigned topics. This table is memmapped from the underlying files and is the most efficient way to access topic information.
get_topic_density(time_field, start, end)
Computes the density/frequency of topics in a given interval of a timestamp field.
Useful for answering questions such as:
- What topics increased in prevalence between December and January?
Parameters:
-
time_field
(str
) –Your metadata field containing isoformat timestamps
-
start
(datetime
) –A datetime object for the window start
-
end
(datetime
) –A datetime object for the window end
Returns:
-
–
List[{topic: str, count: int}] - A list of {topic, count} dictionaries, sorted from largest count to smallest count
Source code in nomic/data_operations.py
group_by_topic(topic_depth=1)
Associates topics at a given depth in the topic hierarchy to the identifiers of their contained datapoints.
Parameters:
-
topic_depth
(int
, default:1
) –Topic depth to group datums by. Acceptable values currently are (1, 2, 3).
Returns: List of dictionaries where each dictionary contains next depth subtopics, subtopic ids, topic_id, topic_short_description, topic_long_description, and list of datum_ids.
Source code in nomic/data_operations.py
vector_search_topics(queries, k=32, depth=3)
Given an embedding, returns a normalized distribution over topics.
Useful for answering the questions such as:
- What topic does my new datapoint belong to?
- Does by datapoint belong to the "Dog" topic or the "Cat" topic.
Parameters:
-
queries
(array
) –a 2d numpy array where each row corresponds to a query vector
-
k
(int
, default:32
) –(Default 32) the number of neighbors to use when estimating the posterior
-
depth
(int
, default:3
) –(Default 3) the topic depth at which you want to search
Returns:
-
Dict
–A dict mapping {topic: posterior probability} for each query