strauss-oak
commited on
Commit
·
53e7541
1
Parent(s):
7d7386e
dev:strealit dashboard
Browse files- database/data.py +2 -0
- pages/News.py +8 -4
database/data.py
CHANGED
@@ -6,6 +6,8 @@ class Data():
|
|
6 |
def __init__(self):
|
7 |
#self.pth_data = 'D://DATA//ufrgs//observatory-brazilian-news//news//'
|
8 |
self.pth_data = 'strauss-oak/observatory-brazilian-news/'
|
|
|
|
|
9 |
|
10 |
|
11 |
|
|
|
6 |
def __init__(self):
|
7 |
#self.pth_data = 'D://DATA//ufrgs//observatory-brazilian-news//news//'
|
8 |
self.pth_data = 'strauss-oak/observatory-brazilian-news/'
|
9 |
+
|
10 |
+
self.pth_data = ' /home/user/app/strauss-oak/observatory-brazilian-news'
|
11 |
|
12 |
|
13 |
|
pages/News.py
CHANGED
@@ -23,10 +23,11 @@ data = Data()
|
|
23 |
|
24 |
|
25 |
def load_ds(media):
|
26 |
-
dir = '{0}
|
27 |
st.info(dir)
|
28 |
files = glob.glob(dir + '/*.csv')
|
29 |
df_list = (pd.read_csv(file) for file in files)
|
|
|
30 |
df = pd.concat(df_list, ignore_index=True)
|
31 |
st.info('Loaded {0} rows and {1} columns'.format(df.shape[0], df.shape[1]))
|
32 |
return df
|
@@ -54,7 +55,10 @@ with c1:
|
|
54 |
#ds = load_hugging_face_ds('jpan')
|
55 |
#st.dataframe(ds)
|
56 |
|
57 |
-
|
|
|
58 |
|
59 |
-
|
60 |
-
|
|
|
|
|
|
23 |
|
24 |
|
25 |
def load_ds(media):
|
26 |
+
dir = '{0}/{1}'.format(data.pth_data, media)
|
27 |
st.info(dir)
|
28 |
files = glob.glob(dir + '/*.csv')
|
29 |
df_list = (pd.read_csv(file) for file in files)
|
30 |
+
st.info(files)
|
31 |
df = pd.concat(df_list, ignore_index=True)
|
32 |
st.info('Loaded {0} rows and {1} columns'.format(df.shape[0], df.shape[1]))
|
33 |
return df
|
|
|
55 |
#ds = load_hugging_face_ds('jpan')
|
56 |
#st.dataframe(ds)
|
57 |
|
58 |
+
df = load_ds('jpan')
|
59 |
+
st.dataframe(df)
|
60 |
|
61 |
+
#dataset = load_dataset("strauss-oak/observatory-brazilian-news")
|
62 |
+
|
63 |
+
#df = pd.DataFrame.from_dict(dataset["train"])
|
64 |
+
#st.dataframe(df)
|