Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
|
@@ -134,14 +134,32 @@ def get_wiki_summary(search):
|
|
| 134 |
pagetext = get_pagetext(page.text)
|
| 135 |
|
| 136 |
backlinks = page.backlinks
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 137 |
categories = page.categories
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 138 |
links = page.links
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 139 |
sections = page.sections
|
| 140 |
|
| 141 |
|
| 142 |
ex_dic = {
|
| 143 |
-
'Entity' : ["URL","Title","Summary", "Text"],
|
| 144 |
-
'Value': [pageurl, pagetitle, pagesummary, pagetext]
|
| 145 |
}
|
| 146 |
|
| 147 |
#columns = [pageurl,pagetitle]
|
|
@@ -187,4 +205,5 @@ with gr.Blocks() as demo: # Block documentation on event listeners, start he
|
|
| 187 |
inp.submit(fn=get_wiki_summary, inputs=inp, outputs=out_DF)
|
| 188 |
b3.click(fn=search, inputs=inp, outputs=out)
|
| 189 |
b4.click(fn=get_wiki_summary, inputs=inp, outputs=out_DF )
|
| 190 |
-
demo.launch(debug=True, show_error=True)
|
|
|
|
|
|
| 134 |
pagetext = get_pagetext(page.text)
|
| 135 |
|
| 136 |
backlinks = page.backlinks
|
| 137 |
+
linklist = ""
|
| 138 |
+
for link in backlinks.items():
|
| 139 |
+
pui = link[0]
|
| 140 |
+
linklist += pui + " , "
|
| 141 |
+
a=1
|
| 142 |
+
|
| 143 |
categories = page.categories
|
| 144 |
+
categorylist = ""
|
| 145 |
+
for category in categories.items():
|
| 146 |
+
pui = category[0]
|
| 147 |
+
categorylist += pui + " , "
|
| 148 |
+
a=1
|
| 149 |
+
|
| 150 |
links = page.links
|
| 151 |
+
linklist2 = ""
|
| 152 |
+
for link in links.items():
|
| 153 |
+
pui = link[0]
|
| 154 |
+
linklist2 += pui + " , "
|
| 155 |
+
a=1
|
| 156 |
+
|
| 157 |
sections = page.sections
|
| 158 |
|
| 159 |
|
| 160 |
ex_dic = {
|
| 161 |
+
'Entity' : ["URL","Title","Summary", "Text", "Backlinks", "Links", "Categories"],
|
| 162 |
+
'Value': [pageurl, pagetitle, pagesummary, pagetext, linklist,linklist2, categorylist ]
|
| 163 |
}
|
| 164 |
|
| 165 |
#columns = [pageurl,pagetitle]
|
|
|
|
| 205 |
inp.submit(fn=get_wiki_summary, inputs=inp, outputs=out_DF)
|
| 206 |
b3.click(fn=search, inputs=inp, outputs=out)
|
| 207 |
b4.click(fn=get_wiki_summary, inputs=inp, outputs=out_DF )
|
| 208 |
+
demo.launch(debug=True, show_error=True)
|
| 209 |
+
|