Skip to content

A utility module for parsing discussion text files downloaded from www.kialo.com

License

Notifications You must be signed in to change notification settings

franznowak/kialoparser

Repository files navigation

Kialo Discussion Parser

A module for parsing exported discussion files from https://www.kialo.com/.

Installing dependencies:

Run the following from the project root:

pip install -r requirements.txt

Downloading a debate:

For instructions on how to download discussions from Kialo see Exporting a Discussion - Kialo Help Centre.

If you have the names of the debates, you can also use the export endpoint like this:

import webbrowser

debate_name = "did-the-exodus-really-happen-14445"

url = "https://www.kialo.com/export/" + debate_name + ".txt?download"

# Replace with the path to Google Chrome if not using Mac:
CHROME_PATH = "open -a /Applications/Google\ Chrome.app %s"

webbrowser.get(CHROME_PATH).open(url)

Using the parser:

from src.discussiontree import DiscussionTree

Create a discussion tree object from a Kialo exported discussion text file:

dt = DiscussionTree("example.csv")

Get a node from the tree:

dt.get_entry("1.1.4.")
{'index': '1.1.4.',
 'content': 'Justified belief requires some sort of evidence. Therefore, belief without evidence is unjustified.',
 'stance': 'Con'}

Retrieve the parent of a node

dt.get_parent("1.1.5.")
{'index': '1.1.',
 'content': 'Absence of evidence is not evidence of absence.',
 'stance': 'Con'}

Get the siblings of a node:

dt.get_siblings("1.1.5.")
[{'index': '1.1.1.',
  'content': 'Absence of evidence is enough to be skeptical about a certain proposition.',
  'stance': 'Con'},
 {'index': '1.1.2.',
  'content': 'There are many events in the Bible asserted as false before being evidenced. Exodus being false would be a premature assertion.',
  'stance': 'Pro'},
 {'index': '1.1.3.',
  'content': 'Absence of evidence when evidence is to be expected to be found is a valid form of evidence in itself.',
  'stance': 'Con'},
 {'index': '1.1.4.',
  'content': 'Justified belief requires some sort of evidence. Therefore, belief without evidence is unjustified.',
  'stance': 'Con'}]

Get the children of a node:

dt.get_children("1.1.5.")
[{'index': '1.1.5.1.',
  'content': 'This does not preclude the possibility that there is insufficient evidence to determine if a claim is true or false. Regardless of that fact though, the burden of proof remains that those making the claim must produce evidence to provide sufficient warrant for their position, or to abandon the claim as true citing there is insufficient evidence to consider it as true, which is not an admission that it is false, merely that it is unknown.',
  'stance': 'Con'}]

Get a claim containing a search term (also accepts regular expressions):

indices = dt.find("fallacy")
dt.get_entry(indices[0])["content"]
'[Appeal to ignorance](https://en.wikipedia.org/wiki/Argument_from_ignorance) is a logical fallacy, it should not be asserted that a proposition is true because it has not yet been proven false.'

About

A utility module for parsing discussion text files downloaded from www.kialo.com

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages