View json_to_csv_snips_NLU.py
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 pandas as pd | |
import time | |
import io | |
import json | |
from langdetect import detect | |
from snips_nlu import SnipsNLUEngine |
View gist:a30907eae2c9e727e63327586ffc6606
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
for i in l: | |
strr = '{' + '\r\n' + ' ' + '"text": ' + '"' + i + '"' +'\r\n' + '}' | |
strr = strr + ',' | |
print(strr) |
View damn_text.py
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 pandas as pd | |
import base64 | |
unclean_data = pd.read_csv('/home/ehz/Downloads/email_date_dec22_Blank.csv') | |
# print(unclean_data) | |
# print(unclean_data.columns.tolist()) | |
# print(unclean_data['Subject']) | |
# super_clean_data = unclean_data[[' Subject',' Customer-Email']].dropna(axis=0, how='any') | |
super_clean_data = unclean_data[' Customer-Email'].dropna(axis=0, how='any') |
View dataset.json
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
{ | |
"entities": { | |
"taka":{ | |
"data": [ | |
{"value": "2 tk","synonyms": ["2 Taka"]} | |
], | |
"use_synonyms": true, | |
"automatically_extensible": true | |
}, | |
"sms":{ |
View is_it_a_valid_json.json
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
{ | |
"entities":{ | |
"language":{ | |
"data":[ | |
{ | |
"value":"English", | |
"synonyms":[ | |
"English" | |
] | |
}, |
View hey_ya.json
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
{ | |
"entities": { | |
"language":{ | |
"data": [ | |
{"value": "English","synonyms": ["English"]}, | |
{"value": "Bangla","synonyms": ["Bangla"]} | |
], | |
"use_synonyms": true, | |
"automatically_extensible": true | |
} |
View rasa_story.py
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
first = ['A'] | |
second = ['B', 'C'] | |
third = ['D', 'E', 'F'] | |
intents_pack = [first, second, third] | |
if intents_pack.index(second) == 1: | |
print('Yes') | |
rasa_stories = [*first] |
View dictionary_flow.py
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
# iterate over a dictionary where values are lists | |
my_dict = { 'alreadyAMerchant': ['track_my_parcel', 'delivery_process', 'create_parcel', 'payment', 'coverage_area', 'merchant_info', 'compl: aints'], 'become_a_merchant': ['how_to_be_a_merchant', 'registration_process']} | |
track_my_parcel = ['This is where you check your product update', 'your parcel is gonna be delayed'] | |
delivery_process = {'option1': 'this is option 1', 'option2': 'this is option 2'} | |
View data.py
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
{ | |
'greet': {'1': 'utter_greet'}, | |
'check_balance': {'1':'utter_ask_account_number', | |
'2': {'inform':{'slot': 'account_number','value': None},'utter': 'utter_confirm_account_number'}, | |
'3': {'confirm':{},'utter': 'utter_ask_pin'}, | |
'4': {'inform':{'slot': 'PIN','value': None},'utter': 'utter_confirm_pin'}, | |
'5': {'confirm':{},'utter': 'utter_balance'}}, | |
'bKash_transfer': {'1':'utter_ask_account_number', | |
'2': {'inform':{'slot': 'account_number','value': None},'utter': 'utter_confirm_account_number'}, | |
'3': {'confirm':{},'utter': 'utter_ask_phone_number'}, |
View yaml_parsar.py
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 yaml | |
# from yaml.loader import SafeLoader | |
# | |
# with open('userdetail.yaml') as f: | |
# data = yaml.load(f, Loader=SafeLoader) | |
# print(data) | |
# | |
import sys | |
from ruamel.yaml import YAML |
NewerOlder