<jupyter_start><jupyter_text>Importing Libraries and Files<jupyter_code>from google.colab import drive
drive.mount('/content/drive/')
!pip install sklearn_crfsuite
import glob
import json
import nltk


nltk.download('stopwords')
from nltk.corpus import stopwords
stop_words = list(stopwords.words('english'))
newStop = ['was', 'and', 'the', 'to', 'in', 'of', 'a', 'an', 'is', 'were', 'for', 'with', 'are', 'one', 'our', 'gave', 'have',
           'me', 'an', 'i', 'or', 'had', 'did', 'get', 'made', 'take', 'given', 'told', 'let', 'us', "n't", 'air', 'one', 'two', 'three', 
          'four', 'five', 'thousand', 'cc', 'twenty', 'ten']
stop_words = stop_words+newStop
stop_words.remove('not')
path = r'/content/drive/My Drive/Practicum/Labelled'
files = glob.glob(path+r'/*.json')
print(len(files))
finInfo = []
for i in range(len(files)):
  for line in open(files[i], encoding='utf-8'):
    info = json.loads(line) 
  finInfo.append(info)
print(len(finInfo))
labels = []
for i in range(len(finInfo)):
  info = finInfo[i]
  for j in range(len(info)):
    if (info[j]['Details'] != []):
      lbls = info[j]['Labels']
      for k in range(len(lbls)):
        for p,q in lbls[k].items():
          for l in range(len(q)):
            labels.append(q[l])
finLabels = []
for i in range(len(labels)):
  new = labels[i].split()
  for j in range(len(new)):
    if new[j] not in stop_words:
      finLabels.append(new[j])

corpus = list(set(finLabels))
len(corpus)
for i in range(len(finInfo)):
  info = finInfo[i]
  for j in range(len(info)):
    det = info[j]['Details']
    for k in range(len(det)):
      if (det[k][-1]) == 'b':
        det[k][-1] = 'o'

details = []
for i in range(len(finInfo)):
  info = finInfo[i]
  for j in range(len(info)):
    dic = {}
    dic['id'] = info[j]['id']
    sent = info[j]['sentence']
    newSent = ' '.join(sent)
    dic['sentences'] = sent
    sentTkn = newSent.split()
    det = info[j]['Details']
    nli = []
    for k in range(len(det)):
      li = []
      for l in range(len(sentTkn)):
        if (det[k][0] == 1):  
          word = det[k][2][0]
          if word in corpus and word not in stop_words:
            if word == sentTkn[l]:
              if (l == 0):
                a = (word, det[k][2][1], det[k][1][0], det[k][1][1], det[k][2][2], det[k][3], '', sentTkn[l+1], det[k][4])
              elif (l == len(sentTkn)-1):
                a = (word, det[k][2][1], det[k][1][0], det[k][1][1], det[k][2][2], det[k][3], sentTkn[l-1], '', det[k][4])
              else:
                a = (word, det[k][2][1], det[k][1][0], det[k][1][1], det[k][2][2], det[k][3], sentTkn[l-1], sentTkn[l+1], det[k][4])
        else:
          word = det[k][1][0]
          if word in corpus and word not in stop_words:
            if word == sentTkn[l]:
              if (l == 0):
                a = (word, det[k][1][1], det[k][1][2], det[k][2][0], det[k][2][1], '', sentTkn[l+1], det[k][4])
              elif (l == len(sentTkn)-1):
                a = (word, det[k][1][1], det[k][1][2], det[k][2][0], det[k][2][1], sentTkn[l-1], '', det[k][4])
              else:
                a = (word, det[k][1][1], det[k][1][2], det[k][2][0], det[k][2][1], sentTkn[l-1], sentTkn[l+1], det[k][4])
        li.append(a)
      li = list(set(li))
      nli.append(li)
    dic['details'] = nli
    details.append(dic)

len(details)
len(list)<jupyter_output><empty_output><jupyter_text>CRF  Getting Data<jupyter_code>data = []
for i in range(len(details)):
  if details[i]['details'] != []:
    det = details[i]['details'] 
    for d in det:
     for combos in d:
       data.append(combos)
len(data)
len(list (set (data)))<jupyter_output><empty_output><jupyter_text>Generating Features<jupyter_code>def word2features(doc):
    word = doc[0]
    wordPos = doc[1]
    depWord = doc[2]
    depWordPos = doc[3]
    depTag = doc[5]
    previousWord = doc[6]
    nextWord = doc[7]

    features = [
        'bias',
        'word.lower=' + word.lower(),
        'previousWord' + previousWord,
        'nextWord=' +nextWord,
        'wordLen=' + str(len(word)),
        'posTag=' + wordPos,
        'depWord=' + str (depWord),
        'depWordPos=' + depWordPos,
        'depTag=' + depTag
        
    ]


    return features
def extract_features(doc):
    return [word2features(doc) for i in range(len(doc))]
def get_labels(doc):
    return [doc[-1] for i in range(len(doc))]<jupyter_output><empty_output><jupyter_text>Getting dependent and independent variables<jupyter_code>X = [extract_features(doc) for doc in data]
y = [get_labels(doc) for doc in data]
len(X), len(y)<jupyter_output><empty_output><jupyter_text>Splitting into training and test data<jupyter_code>from sklearn.model_selection import train_test_split
import numpy as np
X_train, X_test, y_train, y_test = train_test_split(X, y, test_size=0.2)
from sklearn_crfsuite import CRF<jupyter_output><empty_output><jupyter_text>CRF model using Stoachastic Gradient descent with L2 regularization<jupyter_code>model = CRF(algorithm='l2sgd',
    max_iterations=100,
    all_possible_transitions=True)
len(X_train), len(y_train)
for i in range(len(X_train)):
  print(type(X_train[i]))
  break;
model.fit(X_train, y_train)<jupyter_output>/usr/local/lib/python3.6/dist-packages/sklearn/base.py:197: FutureWarning: From version 0.24, get_params will raise an AttributeError if a parameter cannot be retrieved as an instance attribute. Previously it would return None.
  FutureWarning)<jupyter_text>Getting metrics for evaluation<jupyter_code>from sklearn_crfsuite import metrics
 
y_pred = model.predict(X_test)
print(metrics.flat_accuracy_score(y_test, y_pred))
#print(metrics.flat_precision_score(y_test, y_pred))
print(metrics.flat_classification_report(y_test, y_pred))<jupyter_output>0.9432260570695086
              precision    recall  f1-score   support

           c       0.95      0.90      0.93      4471
           e       0.92      0.94      0.93      5846
           f       0.97      0.93      0.95     16342
           i       0.88      0.90      0.89      7980
           o       0.96      0.94      0.95     34606
           p       0.97      0.96      0.96      8028
           s       0.90      0.97      0.94     14269
          st       0.94      0.95      0.94     26875

    accuracy                           0.94    118417
   macro avg       0.94      0.94      0.94    118417
weighted avg       0.94      0.94      0.94    118417<jupyter_text>Saving Trained Model and Evaluation Metrics of the model<jupyter_code>import pickle
filename = '/finalized_crf_model.sav'
pickle.dump(model, open(pathAR+filename, 'wb'))
report = metrics.flat_classification_report(y_test, y_pred)
from sklearn.preprocessing import MultiLabelBinarizer
ml = MultiLabelBinarizer()
ml.fit(y_test)
newy_test = ml.transform(y_test)
newy_pred = ml.transform(y_pred)
roc_auc = roc_auc_score(newy_test, newy_pred, average="macro")
roc_auc
fpr, tpr, _ = roc_curve(newy_test.ravel(), newy_pred.ravel())
precision, recall, _ = precision_recall_curve(newy_test.ravel(), newy_pred.ravel())
errors = abs(newy_pred.ravel() - newy_test.ravel())
fig, ax = pyplot.subplots()
ax.set_title("ROC-AUC Curve")
ax.plot(fpr, tpr, marker='.', label='Conditional Random Field')
# axis labels
ax.set_xlabel('False Positive Rate')
ax.set_ylabel('True Positive Rate')
## show the legend
ax.legend()
fig.savefig(pathAR+r'/'+'crf_ROC AUC curve.png')
ax.cla()
  # plot the precision-recall curves
  ax.set_title("Precision-Recall Curves")
  ax.plot(recall, precision, marker='.', label='Conditional Random Field')
  ax.set_xlabel('Recall')
  ax.set_ylabel('Precision')
  
fig.savefig(pathAR+r'/'+'crf_Precision-Recall Curve.png')
f1 = f1_score(newy_test.ravel(), newy_pred.ravel())
ax.cla()
txt = "Metrics for Condtional Random Field Trained on Original Data\n 1. ROC AUC Score: "+str(roc_auc)+"\t\n 2. F1 Score: "+str(f1)+"\t\n 3. Average absolute error: "+str(round(np.mean(errors), 2))+" degrees"
txt
  text_file = open(pathAR+r'/'+"evaluation_metrics_crf.txt", 'w')
  n = text_file.write(txt)
  r = text_file.write("\n Classification Report is as follows\n"+report)
  text_file.close()
def evaluations(model, y_test, y_pred, modelname):

  report = metrics.classification_report(y_test, y_pred)

  lb = LabelBinarizer()
  lb.fit(y_test)

  y_test = lb.transform(y_test)
  y_pred = lb.transform(y_pred)

  roc_auc = roc_auc_score(y_test, y_pred, average="macro")
  
  fpr, tpr, _ = roc_curve(y_test.ravel(), y_pred.ravel())

  precision, recall, _ = precision_recall_curve(y_test.ravel(), y_pred.ravel())


  errors = abs(y_pred.ravel() - y_test.ravel())

  fig, ax = pyplot.subplots()
  ax.set_title("ROC-AUC Curve")
  ax.plot(fpr, tpr, marker='.', label='Random Forest')
  # axis labels
  ax.set_xlabel('False Positive Rate')
  ax.set_ylabel('True Positive Rate')
  ## show the legend
  ax.legend()
  # show the plot
  fig.savefig(pathTA+r'/'+modelname+'_ROC-AUC Curve.png')

  ax.cla()
  # plot the precision-recall curves
  ax.set_title("Precision-Recall Curves")
  ax.plot(recall, precision, marker='.', label='Random Forest')
  ax.set_xlabel('Recall')
  ax.set_ylabel('Precision')
  fig.savefig(pathTA+r'/'+modelname+'_Precision-Recall Curve.png')

  f1 = f1_score(y_test.ravel(), y_pred.ravel())
  
  
  ax.cla()
  
  txt = "Metrics for Random Forest Trained on Original Data\n 1. ROC AUC Score: "+str(roc_auc)+"\t\n 2. F1 Score: "+str(f1)+"\t\n 3. Average absolute error: "+str(round(np.mean(errors), 2))+" degrees"

  text_file = open(pathTA+r'/'+"evaluation_metrics_"+modelname+".txt", 'w')
  n = text_file.write(txt)
  r = text_file.write("\n Classification Report is as follows\n"+report)
  text_file.close()<jupyter_output><empty_output><jupyter_text>Classification Part, DO NOT RUN, CODE only for reference<jupyter_code>import json
import glob
import pandas as pd

from sklearn.preprocessing import OneHotEncoder
from keras.preprocessing.text import Tokenizer

import pandas as pd
from sklearn.feature_extraction.text import CountVectorizer
from sklearn.model_selection import train_test_split
from sklearn.linear_model import LogisticRegression
import matplotlib.pyplot as plt
plt.style.use('ggplot')
from sklearn.preprocessing import LabelEncoder
from keras.models import Sequential
from keras import layers
from sklearn.preprocessing import OneHotEncoder
from keras.preprocessing.text import Tokenizer
from keras.preprocessing.sequence import pad_sequences
import numpy as np
import xml.etree.ElementTree as ET, getopt, logging, sys, random, re, copy, os
from lxml import etree
from keras.wrappers.scikit_learn import KerasClassifier
from sklearn.model_selection import RandomizedSearchCV

from keras import backend as K

import pickle
def changeAspectTerm(dataframe, aspectterm, key):
  newdf = pd.DataFrame()
  newdf['id'] = dataframe['id']
  newdf['word'] = dataframe[aspectterm]
  newdf['Aspect'] = key+'_'+dataframe['Aspect'].str.lower().astype(str)
  newdf['id_updated'] = dataframe['id_updated']

  return newdf
df = pd.read_csv(pathAR+r'/FinalCabinAspects.csv')
df.columns
newdf = changeAspectTerm(df, 'Cabin', 'cabin')
newdf.head()
totLst = []
totLst.append(newdf)
len(totLst[-1]), len(newdf)
len(totLst)
df_aspect = pd.DataFrame()
df_aspect=pd.concat(totLst, ignore_index=True)
df_aspect.sample(10)
len(df_aspect)
pathAR = r'/content/drive/My Drive/Practicum/Labelled/AirlineRatings'
filesAR = glob.glob(pathAR+r'/*.csv')
pathTA = r'/content/drive/My Drive/Practicum/Labelled/TripAdvisor'
filesTA = glob.glob(pathTA+r'/*.csv')
totFiles = filesAR + filesTA
len(totFiles)
details = []
for i in range(len(finInfo)):
  info = finInfo[i]
  for j in range(len(info)):
    dic = {}
    ids = info[j]['id']
    dic['id'] = info[j]['id']
    sent = info[j]['sentence']
    newSent = ' '.join(sent)
    dic['sentences'] = sent
    sentTkn = newSent.split()
    det = info[j]['Details']
    nli = []
    for k in range(len(det)):
      li = []
      for l in range(len(sentTkn)):
        if (det[k][0] == 1):  
          word = det[k][2][0]
          if word in corpus and word not in stop_words:
            if word == sentTkn[l]:
              if (l == 0):
                a = (word, det[k][2][1], det[k][1][0], det[k][1][1], det[k][2][2], det[k][3], '', sentTkn[l+1], det[k][4], ids)
              elif (l == len(sentTkn)-1):
                a = (word, det[k][2][1], det[k][1][0], det[k][1][1], det[k][2][2], det[k][3], sentTkn[l-1], '', det[k][4], ids)
              else:
                a = (word, det[k][2][1], det[k][1][0], det[k][1][1], det[k][2][2], det[k][3], sentTkn[l-1], sentTkn[l+1], det[k][4], ids)
        else:
          word = det[k][1][0]
          if word in corpus and word not in stop_words:
            if word == sentTkn[l]:
              if (l == 0):
                a = (word, det[k][1][1], det[k][1][2], det[k][2][0], det[k][2][1], '', sentTkn[l+1], det[k][4])
              elif (l == len(sentTkn)-1):
                a = (word, det[k][1][1], det[k][1][2], det[k][2][0], det[k][2][1], sentTkn[l-1], '', det[k][4])
              else:
                a = (word, det[k][1][1], det[k][1][2], det[k][2][0], det[k][2][1], sentTkn[l-1], sentTkn[l+1], det[k][4])
        li.append(a)
      li = list(set(li))
      nli.append(li)
    dic['details'] = nli
    details.append(dic)
len(details)
data = []
for i in range(len(details)):
    if details[i]['details'] != []:
        det = details[i]['details']
        for d in det:
            for combos in d:
                data.append(combos)

data = list(set(data))
            
print(len(data))
columns=['main','main_pos','dep','dep_pos','main_sent','dep_tag','prev','next','entity','id']
df_entity=pd.DataFrame(data)
df_entity.columns=columns
len(df_entity)
df_entity.sample(20)
len(df_aspect), len(df_entity)
df_data=pd.merge(df_entity, df_aspect, how='inner', left_on=['id','main'], right_on=['id','word'],
         left_index=False, right_index=False, sort=True)
df_data.sample(10)
details[0]
alltxt = []
for i in range(len(details)):
  for j in range(len(details[i]['sentences'])):
    alltxt.append(details[i]['sentences'][j])
len(alltxt)
tokenizer = Tokenizer(num_words = 5000)
tokenizer.fit_on_texts(alltxt)
#main dep prev next
# Text to sequence

df_data['main_s']=df_data['main'].apply( lambda x: tokenizer.texts_to_sequences([x])).apply(lambda x: (x[0])[-1] if x!=[[]] else 0 )
df_data['dep_s']=df_data['dep'].apply( lambda x: tokenizer.texts_to_sequences([x])).apply(lambda x: (x[0])[-1] if x!=[[]] else 0 )
df_data['prev_s']=df_data['prev'].apply( lambda x: tokenizer.texts_to_sequences([x])).apply(lambda x: (x[0])[-1] if x!=[[]] else 0 )
df_data['next_s']=df_data['next'].apply( lambda x: tokenizer.texts_to_sequences([x])).apply(lambda x: (x[0])[-1] if x!=[[]] else 0 )
#main_pos  dep_pos dep_tag
#One hot encoding 

df_main_pos=pd.get_dummies(df_data['main_pos'],prefix='main_pos')
df_dep_pos=pd.get_dummies(df_data['dep_pos'],prefix='dep_pos')
df_dep_tag=pd.get_dummies(df_data['dep_tag'],prefix='dep_tag')

df_data2=pd.concat([df_data,df_main_pos,df_dep_pos,df_dep_tag], axis=1)
df_data2.head()
df_data2=pd.concat([df_data,df_main_pos,df_dep_pos,df_dep_tag], axis=1)

new_columns=['main_s','dep_s', 'prev_s', 'next_s','main_sent'] + list(df_main_pos.columns)+ list(df_dep_pos.columns)+ list(df_dep_tag.columns)+['Aspect']
df_data3=df_data2[new_columns]
len(list(df_data3.columns))

from sklearn.ensemble import RandomForestClassifier

def getPredictions(x_train, x_test, y_train, model):#, test):
    
    predictions = model.predict(x_test)
    return predictions
def check_acc(pred,y_test):
    right=0
    for i in range(len(y_test)):
        if pred[i]==y_test.iloc[i]:
            right+=1
    return right/len(y_test)
def classifyModel(dataframe, modelname):
  msk=(np.random.rand(len(dataframe)) < 0.8)
  train=dataframe[msk]
  test=dataframe[~msk]


  x_train=train[x_columns]
  x_test=test[x_columns]
  y_train=train['Aspect']
  y_test=test['Aspect']


  model = RandomForestClassifier(n_estimators=150)
  model.fit(x_train, y_train)
  with open(pathTA+r'/'+modelname+'.sav', 'wb') as f:
    pickle.dump(model, f)


  pred = getPredictions(x_train, x_test, y_train, model)

  return pred, y_test
x_columns=['main_s','dep_s', 'prev_s', 'next_s','main_sent'] + list(df_main_pos.columns)+ list(df_dep_pos.columns)+ list(df_dep_tag.columns)
df_data_food=df_data3[df_data3['Aspect'].str.contains("food")]
df_data_entertainment=df_data3[df_data3['Aspect'].str.contains("entertainment")]
df_data_cabin=df_data3[df_data3['Aspect'].str.contains("cabin")]
df_data_inflight=df_data3[df_data3['Aspect'].str.contains("inf")]
df_data_offflight=df_data3[df_data3['Aspect'].str.contains("off")]
df_data_possession=df_data3[df_data3['Aspect'].str.contains("possession")]
df_data_seat=df_data3[df_data3['Aspect'].str.contains("seat")]
df_data_staff=df_data3[df_data3['Aspect'].str.contains("staff")]
df_data_entertainment = df_data_entertainment.replace({'entertainment_s':'entertainment_audio', 'entertainment_c': 'entertainment_general'})
df_data_entertainment, df_data_cabin, df_data_food, df_data_inflight, df_data_offflight, df_data_possession, df_data_seat, df_data_staff
predict_, test_ = classifyModel(df_data_staff, 'staff')
check_acc(food_pred, food_test)<jupyter_output><empty_output><jupyter_text>Score<jupyter_code>from sklearn.preprocessing import LabelBinarizer
from matplotlib import pyplot
from sklearn.metrics import precision_recall_curve
from sklearn.metrics import f1_score
from sklearn.metrics import auc
from sklearn.metrics import f1_score
from sklearn.metrics import confusion_matrix
from sklearn.metrics import auc
import seaborn as sns
import matplotlib.pyplot as plt
from sklearn.metrics import precision_recall_curve
from sklearn.preprocessing import LabelBinarizer
from sklearn import metrics
from sklearn import metrics
def evaluations(model, y_test, y_pred, modelname):

  report = metrics.classification_report(y_test, y_pred)

  lb = LabelBinarizer()
  lb.fit(y_test)

  y_test = lb.transform(y_test)
  y_pred = lb.transform(y_pred)

  roc_auc = roc_auc_score(y_test, y_pred, average="macro")
  
  fpr, tpr, _ = roc_curve(y_test.ravel(), y_pred.ravel())

  precision, recall, _ = precision_recall_curve(y_test.ravel(), y_pred.ravel())


  errors = abs(y_pred.ravel() - y_test.ravel())

  fig, ax = pyplot.subplots()
  ax.set_title("ROC-AUC Curve")
  ax.plot(fpr, tpr, marker='.', label='Random Forest')
  # axis labels
  ax.set_xlabel('False Positive Rate')
  ax.set_ylabel('True Positive Rate')
  ## show the legend
  ax.legend()
  # show the plot
  fig.savefig(pathTA+r'/'+modelname+'_ROC-AUC Curve.png')

  ax.cla()
  # plot the precision-recall curves
  ax.set_title("Precision-Recall Curves")
  ax.plot(recall, precision, marker='.', label='Random Forest')
  ax.set_xlabel('Recall')
  ax.set_ylabel('Precision')
  fig.savefig(pathTA+r'/'+modelname+'_Precision-Recall Curve.png')

  f1 = f1_score(y_test.ravel(), y_pred.ravel())
  
  
  ax.cla()
  
  txt = "Metrics for Random Forest Trained on Original Data\n 1. ROC AUC Score: "+str(roc_auc)+"\t\n 2. F1 Score: "+str(f1)+"\t\n 3. Average absolute error: "+str(round(np.mean(errors), 2))+" degrees"

  text_file = open(pathTA+r'/'+"evaluation_metrics_"+modelname+".txt", 'w')
  n = text_file.write(txt)
  r = text_file.write("\n Classification Report is as follows\n"+report)
  text_file.close()
def getImportant(model, feature_list, modelname):
  importances = list(model.feature_importances_)

  feature_importances = [(feature, round(importance, 2)) for feature, importance in zip(feature_list, importances)]

  feature_importances = sorted(feature_importances, key = lambda x: x[1], reverse = True)
  newimportances = []
  newfeaturelist = []
  for i in range(len(feature_importances)):
    if (i <= 5):
      newimportances.append(feature_importances[i][1])
      newfeaturelist.append(feature_importances[i][0])
  

  # list of x locations for plotting
  x_values = list(range(len(newimportances)))                             

  # Make a bar chart
  pyplot.bar(x_values, newimportances, orientation = 'vertical', color = 'r', edgecolor = 'k', linewidth = 1.2)

  # Tick labels for x axis
  pyplot.xticks(x_values, newfeaturelist, rotation='vertical')

  # Axis labels and title
  pyplot.ylabel('Importance')
  pyplot.xlabel('Variable')
  pyplot.title('Variable Importances')
  pyplot.savefig(pathTA+r'/'+modelname+'_Variable-Importances.png')
def classifyModel(dataframe, modelname):
  msk=(np.random.rand(len(dataframe)) < 0.8)
  train=dataframe[msk]
  test=dataframe[~msk]


  x_train=train[x_columns]
  x_test=test[x_columns]
  y_train=train['Aspect']
  y_test=test['Aspect']

  feature_list = list(dataframe.columns)



  model = RandomForestClassifier(n_estimators=150)
  model.fit(x_train, y_train)
  with open(pathTA+r'/'+modelname+'.sav', 'wb') as f:
    pickle.dump(model, f)

  
  pred = getPredictions(x_train, x_test, y_train, model)

  
  evaluations(model, y_test, pred, modelname)

  getImportant(model, feature_list, modelname)

  labels = np.unique(y_test) 
  a = confusion_matrix(y_test, pred, labels=labels) 
  
  #print(a)

  cm_df = pd.DataFrame(a, index=labels, columns=labels)
  plt.figure(figsize=(10,10))  
  sns.heatmap(cm_df, annot=True, fmt='g')

  plt.savefig(pathTA+r'/'+modelname+'_Confusion Matrix.png')
  
  return pred, y_test
model.decision_path()
list(df_data_entertainment['Aspect'].unique())<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16335499555846464, 'fraction_numerical': 0.020571321707419703, 'mean_word_length': 4.15421686746988, 'pattern_counts': {'":': 0, '<': 42, '<?xml version=': 0, '>': 39, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 2}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 9, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '10', 'dir': 'jupyter-structured-clean-dedup', 'id': '289158', 'license': 'Apache-2.0', 'n_tokens_mistral': 8296, 'n_tokens_neox': 7951, 'n_words': 1592, 'path': 'src/CRF/src/CRFmodel.ipynb', 'repo_name': 'vaibhavoberoi/implicit_aspect_airline_reviews', 'size': '21389'}