victormiller commited on
Commit
38049d1
1 Parent(s): ffdb8be

Update overview.py

Browse files
Files changed (1) hide show
  1. overview.py +42 -0
overview.py CHANGED
@@ -209,6 +209,47 @@ dataset_sources = pd.DataFrame(
209
  table_html = dataset_sources.to_html(index=False, border=0)
210
  table_div1 = Div(NotStr(table_html), style="margin: 40px;")
211
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
212
  quality_text = P("""The quality and size of a pre-training dataset play a crucial role in the performance of large language models (LLMs).
213
  The community has introduced a variety of datasets for this purpose, including purely web-based datasets like RefinedWeb{citation_obj.display_citation("refinedweb")}, RedPajama-Data-V2{citation_obj.display_citation("redpajama-v2")}, DCLM{citation_obj.display_citation("dclm")}, and FineWeb{citation_obj.display_citation("fineweb")},
214
  as well as comprehensive datasets derived from multiple highly-curated data sources such as The Pile{citation_obj.display_citation("thepile")}, RedPajama-Data-V1{citation_obj.display_citation("redpajama-v1")}, and Dolma{citation_obj.display_citation("dolma")}.
@@ -239,6 +280,7 @@ def overview():
239
  table_div,
240
  P("Table 2: Basic TxT360 Statistics."),
241
  table_div1,
 
242
  id="inner-text",
243
  )
244
  )
 
209
  table_html = dataset_sources.to_html(index=False, border=0)
210
  table_div1 = Div(NotStr(table_html), style="margin: 40px;")
211
 
212
+
213
+ def get_curated_chart():
214
+ # Dataset
215
+ data = {
216
+ 'Source': ['ArXiv', 'PubMed Central', 'PubMed Abstract', 'S2ORC Full Text', 'S2ORC Abstract', 'PhilPapers', 'Wikipedia', 'StackExchange', 'EuroParl', 'Ubuntu IRC', 'Freelaw', 'PG19', 'USPTO', 'HackerNews', 'DM Maths'],
217
+ 'Category': ['Papers', 'Papers', 'Papers', 'Papers', 'Papers', 'Papers', 'Internet', 'Conversational', 'Legal/Formal', 'Conversational', 'Legal/Formal', 'Books', 'Legal/Formal', 'Conversational', 'Reasoning'],
218
+ 'Count': [100, 200, 150, 120, 80, 90, 300, 250, 180, 150, 150, 250, 180, 120, 90],
219
+ 'Details': [
220
+ 'A repository of scientific papers in various disciplines, including computer science, physics, mathematics, and more.',
221
+ 'A database of biomedical and life sciences research articles.',
222
+ 'Abstracts of biomedical literature from various sources.',
223
+ 'Full-text articles from the Semantic Scholar Open Research Corpus.',
224
+ 'Abstracts of articles from the Semantic Scholar Open Research Corpus.',
225
+ 'Papers from the PhilPapers database, a comprehensive index and bibliography of philosophy research.',
226
+ 'A collaborative online encyclopedia that covers a wide range of topics.',
227
+ 'A network of question-and-answer websites on various subjects, including programming, science, mathematics, and more.',
228
+ 'A collection of multilingual parallel corpora of parliamentary debates from the European Parliament.',
229
+ 'Chat logs from the Ubuntu Internet Relay Chat (IRC) channels.',
230
+ 'Legal documents and court cases from various jurisdictions.',
231
+ 'A collection of books from Project Gutenberg, a digital library of public domain works.',
232
+ 'Patent documents from the United States Patent and Trademark Office.',
233
+ 'User-generated news and discussion platform focused on technology and startups.',
234
+ 'Deep Mind Maths dataset with generated questions.'
235
+ ]
236
+ }
237
+ # Calculate percentage for each data source
238
+ total_count = sum(data['Count'])
239
+ data['Percentage'] = [count / total_count * 100 for count in data['Count']]
240
+
241
+ # Create treemap
242
+ fig = px.treemap(data, path=['Category', 'Source'], values='Count', hover_data=['Details', 'Percentage'], hover_name='Source')
243
+
244
+ # Set the size of the chart
245
+ fig.update_layout(width=800, height=600)
246
+
247
+ # Display treemap
248
+ st.plotly_chart(fig)
249
+
250
+
251
+
252
+
253
  quality_text = P("""The quality and size of a pre-training dataset play a crucial role in the performance of large language models (LLMs).
254
  The community has introduced a variety of datasets for this purpose, including purely web-based datasets like RefinedWeb{citation_obj.display_citation("refinedweb")}, RedPajama-Data-V2{citation_obj.display_citation("redpajama-v2")}, DCLM{citation_obj.display_citation("dclm")}, and FineWeb{citation_obj.display_citation("fineweb")},
255
  as well as comprehensive datasets derived from multiple highly-curated data sources such as The Pile{citation_obj.display_citation("thepile")}, RedPajama-Data-V1{citation_obj.display_citation("redpajama-v1")}, and Dolma{citation_obj.display_citation("dolma")}.
 
280
  table_div,
281
  P("Table 2: Basic TxT360 Statistics."),
282
  table_div1,
283
+ plotly2fasthtml(get_curated_chart()),
284
  id="inner-text",
285
  )
286
  )