Update app.py
Browse files
app.py
CHANGED
|
@@ -53,12 +53,13 @@ def initialize(limit, rando, use_cache=True):
|
|
| 53 |
cluster_meta : List[article_meta] = []
|
| 54 |
for data_source in sources:
|
| 55 |
if limit is not None:
|
|
|
|
| 56 |
c_data, c_meta = data_source.retrieve_cluster_data(limit//len(sources))
|
| 57 |
else:
|
| 58 |
c_data, c_meta = data_source.retrieve_cluster_data()
|
| 59 |
cluster_data.append(c_data)
|
| 60 |
cluster_meta.append(article_meta(data_source.source_name, c_meta))
|
| 61 |
-
st.session_state[data_source.source_name] = f"Number of clusters from source: {
|
| 62 |
print("Finished...moving on to clustering...")
|
| 63 |
cluster_data = cluster_data[0] + cluster_data[1]
|
| 64 |
# NER
|
|
@@ -76,7 +77,7 @@ def initialize(limit, rando, use_cache=True):
|
|
| 76 |
# Else reference digestor instance so summary can be found.
|
| 77 |
article_dict = {stub.hed: stub for stub in cluster_data}
|
| 78 |
|
| 79 |
-
|
| 80 |
return article_dict, clusters
|
| 81 |
|
| 82 |
|
|
|
|
| 53 |
cluster_meta : List[article_meta] = []
|
| 54 |
for data_source in sources:
|
| 55 |
if limit is not None:
|
| 56 |
+
# c_data is a list of articleTuples and c_meta is the length of that but actually the length of one of the source lists...weird.
|
| 57 |
c_data, c_meta = data_source.retrieve_cluster_data(limit//len(sources))
|
| 58 |
else:
|
| 59 |
c_data, c_meta = data_source.retrieve_cluster_data()
|
| 60 |
cluster_data.append(c_data)
|
| 61 |
cluster_meta.append(article_meta(data_source.source_name, c_meta))
|
| 62 |
+
st.session_state[data_source.source_name] = f"Number of clusters from source: {c_meta}"
|
| 63 |
print("Finished...moving on to clustering...")
|
| 64 |
cluster_data = cluster_data[0] + cluster_data[1]
|
| 65 |
# NER
|
|
|
|
| 77 |
# Else reference digestor instance so summary can be found.
|
| 78 |
article_dict = {stub.hed: stub for stub in cluster_data}
|
| 79 |
|
| 80 |
+
st.write(cluster_meta)
|
| 81 |
return article_dict, clusters
|
| 82 |
|
| 83 |
|