Skip to content

Commit

Permalink
Remove krippendorff dependency, see #14
Browse files Browse the repository at this point in the history
  • Loading branch information
abhidg committed Aug 9, 2020
1 parent 4c45b7e commit ceb5a6e
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 18 deletions.
20 changes: 3 additions & 17 deletions jamie/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,6 @@

import json
import collections
import krippendorff
import pandas as pd
import numpy as np
from pathlib import Path
Expand All @@ -19,7 +18,7 @@
import jamie.predict
import jamie.reports
from jamie.information_gain import _information_gain
from jamie.lib import connect_mongo, arrow_table, check_nltk_download, setup_messages
from jamie.lib import connect_mongo, check_nltk_download, setup_messages

NLTK_DATA = ["stopwords", "punkt"]

Expand Down Expand Up @@ -230,7 +229,7 @@ def distribution(self, kind):
print("Total:", data.frequency.sum())

def reliability(self, snapshot=None):
"Inter-rater reliability of training set ratings"
"Prepare data for input into inter-rater reliability program"
# Select snapshot if specified or most recent training snapshot
snapshot = (
snapshot or jamie.snapshots.TrainingSnapshotCollection().most_recent()
Expand All @@ -244,17 +243,4 @@ def reliability(self, snapshot=None):
list(snapshot.data["tags_2"]),
list(snapshot.data["tags_3"]),
]
_reliability = [
(
"Krippendorff's alpha (ordinal)",
krippendorff.alpha(reliability_data, level_of_measurement="ordinal"),
)
]
del reliability_data[-1] # drop third coder
_reliability.append(
(
"Krippendorff's alpha -- two coders (ordinal)",
krippendorff.alpha(reliability_data, level_of_measurement="ordinal"),
)
)
return arrow_table(_reliability)
return json.dumps(reliability_data)
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,6 @@
packages=["jamie", "jamie.scrape", "jamie.features", "jamie.data"],
install_requires=[
"chevron", # mustache templating
"krippendorff", # reliability calculations
"matplotlib",
"pymongo>=3.4.0",
"fire", # command line interface
Expand Down

0 comments on commit ceb5a6e

Please sign in to comment.