Skip to content
This repository has been archived by the owner on May 5, 2023. It is now read-only.

new revision #15

Merged
merged 31 commits into from
Jul 13, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
31 commits
Select commit Hold shift + click to select a range
c107544
docs: added example files
Jul 7, 2021
2eaa499
new revision needs new libraries
Jul 7, 2021
96af48d
added example script by users
Jul 7, 2021
fd4f5f0
new revision readme
Jul 7, 2021
9338b1c
modified: autocards.py
Jul 7, 2021
db01b7e
Update README.md
thiswillbeyourgithub Jul 7, 2021
03ca81c
Update autocards.py
thiswillbeyourgithub Jul 7, 2021
1204b35
better _sanitize_text function
Jul 9, 2021
4cc55c5
style: methods called after pandas
Jul 9, 2021
0142744
remove function defined but used once
Jul 9, 2021
d1a6abf
removed commented section launching pdb
Jul 9, 2021
9d5d8c3
better docstring for sanitize text
Jul 9, 2021
4355add
removed unecessary import from the commented area
Jul 9, 2021
f18762c
style: added better default titles
Jul 9, 2021
3e57726
PEP8: line was too long
Jul 9, 2021
e139367
modified: autocards.py
Jul 9, 2021
823e4ff
minor: wrong fstring and extra newline at EOF
Jul 9, 2021
c1d2b25
fix: better title for text file
Jul 9, 2021
ea70298
docs: csv_export is now to_csv, same for json
Jul 10, 2021
6fcb6db
docs: clearer text
Jul 10, 2021
213c121
missing ebooklib + remove extra newline
Jul 10, 2021
90c69ae
docs: minor phrasing
Jul 10, 2021
de023d2
remove useless notebook
Jul 10, 2021
dea3d44
style: renamed qa_pairs to qa_dict
Jul 10, 2021
6e94f6b
phrasing
Jul 11, 2021
bb82eb9
more robust epub extraction
Jul 11, 2021
088bfe6
adds basic cloze functionnality and notetype
Jul 12, 2021
0f40dd3
adds basic cloze functionnality and notetype
Jul 12, 2021
92eca6a
added docstring for main class
Jul 12, 2021
3576c7f
feat: added a store_content and watermark flag
Jul 12, 2021
978e9ff
minor style
Jul 12, 2021
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3,511 changes: 0 additions & 3,511 deletions Autocards_Demo_Notebook.ipynb

This file was deleted.

41 changes: 40 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,41 @@
# Autocards
Learn more by reading [the official write-up](https://psionica.org/docs/lab/autocards/).
* Automatically create questions and answers from various input formats (PDF files, webpages, wikipedia, epub files, etc) then export them into your favorite flashcards software (like [anki](https://apps.ankiweb.net/) or [SuperMemo](https://supermemo.guru/wiki/SuperMemo))
* To see a real world example, the complete output of [this article](https://www.biography.com/political-figure/philip-ii-of-macedon) can be found [in this folder](./output_example/). It's the direct output with no post processing whatsoever.
* Code is PEP compliant and with docstrings. Contributions and PR are extremely appreciated
* Learn more by reading [the official write-up](https://psionica.org/docs/lab/autocards/).

## Install guide:
* `git clone https//github.com/Psionica/Autocards`
* `cd Autocards`
* `pip install -r ./requirements.txt`
* open a python console: `ipython3`
* install punkt by running `!python -m nltk.downloader punkt`

### Autocards usage
```
# loading
from autocards import Autocards
a = Autocards()

# eating the input text using one of the following ways:
a.consume_var(my_text, per_paragraph=True)
a.consume_user_input(title="")
a.consume_wiki_summary(keyword, lang="en")
a.consume_textfile(filename, per_paragraph=True)
a.consume_pdf(pdf_path, per_paragraph=True)
a.consume_web(source, mode="url", element="p")
# => * element is the html element, like p for paragraph
# * mode can be "url" or "local"

# three ways to get the results back: printing, pandas, export
out = a.string_output(prefix='', jeopardy=False)
# => * prefix is a text that will be appended before the qa
# * jeopardy is when switching question and answer
a.print(prefix='', jeopardy=False)
a.pprint(prefix='', jeopardy=False) # pretty printing
df = a.pandas_output(prefix='')
a.to_csv("output.csv", prefix="", jeopardy=False)
a.to_json("output.json", prefix="", jeopardy=False)

# Also note that a user provided his own terrible scripts that you can get inspiration from, they are located in the folder `examples_script`
```
Loading