<jupyter_start><jupyter_text>\ Developer: <NAME> (<EMAIL>) \ 29th December 2018 \ © 2019 initOS GmbH \ License MIT<jupyter_code>import numpy as np
import pandas as pd
import nltk, os
from nltk.corpus import sentiwordnet as swn
from pprint import pprint
from nltk.stem.wordnet import WordNetLemmatizer
from nltk.corpus import wordnet
import itertools, string, re, unidecode, icu, time, pickle
from gensim.models import Phrases
from gensim.models.phrases import Phraser
from nltk import bigrams
from langdetect import detect
from textblob import TextBlob
from pattern.en import sentiment
bugs = pd.read_csv('../datasets/lexical_semantic_preprocessed_mantis_bugs_less_columns.csv')
#Priority
#10: none
#20: low
#30: normal
#40: high
#50: urgent
#60: immediate

#Severity
#10: feature
#20: trivial
#30: text
#40: tweak
#50: minor
#60: major
#70: crash
#80: block
bugs['severity'].value_counts()
critical = bugs[bugs['severity'].isin([60, 70, 80])].index
non_critical = bugs[bugs['severity'].isin([10, 20, 30, 40])].index

bugs['class'] = np.nan

bugs.loc[critical,'class'] = 'critical'

bugs.loc[non_critical,'class'] = 'non-critical'

len(bugs[bugs['class'].isnull()]), len(bugs[bugs['class'] == 'critical']), len(bugs[bugs['class'] == 'non-critical'])

bugs.to_csv('../datasets/lexical_semantic_preprocessed_mantis_bugs_less_columns_with_class.csv', encoding='utf-8', index=False)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.13920454545454544, 'fraction_numerical': 0.037642045454545456, 'mean_word_length': 6.741758241758242, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 7, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '526664', 'license': 'MIT', 'n_tokens_mistral': 573, 'n_tokens_neox': 494, 'n_words': 129, 'path': '1) preprocessing/5.class_labelling.ipynb', 'repo_name': 'initOS/research-criticality-identification', 'size': '1428'}