This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# coding: utf-8 | |
""" | |
Author : weaming | |
Created Time : 2018-05-26 21:32:59 | |
Prerequisite: | |
python3 -m pip install cson arrow | |
""" | |
import json | |
import os |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/usr/bin/env python3 | |
# coding: utf-8 | |
""" | |
Author : noklam | |
Created Time : 2019-11-09 12:30:04 | |
Base on: https://gist.github.com/weaming/32b7b62956b304ff66fbae396ca9c86b | |
Prerequisite: | |
python3 -m pip install cson arrow | |
""" | |
import json |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# Fetch some text content in two different categories | |
from wikipediaapi import Wikipedia | |
wiki = Wikipedia('RAGBot/0.0', 'en') | |
docs = [{"text": x, | |
"category": "person"} | |
for x in wiki.page('Hayao_Miyazaki').text.split('\n\n')] | |
docs += [{"text": x, | |
"category": "film"} | |
for x in wiki.page('Spirited_Away').text.split('\n\n')] |