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
''' | |
# Baseline script by Supreet Manyam (Ziron) | |
''' | |
import pandas as pd | |
import numpy as np | |
import gc | |
train = pd.read_csv("data/train.csv", |
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
import numpy as np | |
import pandas as pd | |
from sklearn.metrics import f1_score | |
from copy import deepcopy | |
from collections import namedtuple | |
# Evaluation metric for Innoplexus NER Challenge | |
def collect_named_entities(tokens): # Helper Function for score calculation |
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
def apk(actual, predicted, k=3): | |
""" | |
Computes the average precision at k. | |
This function computes the average prescision at k between two lists of | |
items. | |
Parameters | |
---------- | |
actual : list | |
A list of elements that are to be predicted (order doesn't matter) | |
predicted : list |
NewerOlder