This file contains hidden or 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
| result, model_outputs, predictions = model.eval_model(test_df) | |
| predictions, raw_outputs = model1.predict(["Tax Rate"]) | |
| print(predictions) |
This file contains hidden or 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
| result, model_outputs, predictions = model.eval_model(test_df) |
This file contains hidden or 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
| from simpletransformers.ner import NERModel | |
| import logging | |
| logging.basicConfig(level=logging.INFO) | |
| transformers_logger = logging.getLogger("transformers") | |
| transformers_logger.setLevel(logging.WARNING) | |
| train_df = pd.DataFrame(traindata, columns=['sentence_id', 'words', 'labels']) | |
| test_df = pd.DataFrame(testdata, columns=['sentence_id', 'words', 'labels']) | |
| model = NERModel('bert', 'bert-base-cased', | |
| labels=[ENTER YOUR LIST OF UNIQUE LABELS IN YOUR DATA], |
This file contains hidden or 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 | |
| df=pd.read_csv("drive/My Drive/Data.csv") | |
| Sentences=df['Text'] | |
| df['Labels'] = df['Unnamed: 1'].astype(str) +" "+ df['Unnamed: 2'].astype(str)+" "+ df['Unnamed: 3'].astype(str)+" "+ df['Unnamed: 4'].astype(str)+" "+ df['Unnamed: 5'].astype(str)+" "+ df['Unnamed: 6'].astype(str)+" "+ df['Unnamed: 7'].astype(str)+" "+ df['Unnamed: 8'].astype(str)+" "+ df['Unnamed: 9'].astype(str)+" "+ df['Unnamed: 10'].astype(str)+" "+ df['Unnamed: 11'].astype(str) | |
| df=df.drop(columns=['Unnamed: 1', 'Unnamed: 2', 'Unnamed: 3', 'Unnamed: 4', | |
| 'Unnamed: 5', 'Unnamed: 6', 'Unnamed: 7', 'Unnamed: 8', 'Unnamed: 9', | |
| 'Unnamed: 10', 'Unnamed: 11'],axis=1) | |
| Labels=df['Labels'] | |
| traindata=[] | |
| for i in range(0,len(Sentences[:95])): |
This file contains hidden or 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
| from datetime import datetime , timedelta | |
| import pandas as pd | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from pycaret.regression import * | |
| import requests | |
| from wwo_hist import retrieve_hist_data | |
| date=(input("enter the month and year for which you want to predict the sales of the product [EXAMPLE : 02-2020 (FEB 2020)]: ")) | |
| print("The Products are : \n ALCOHOL , BREAD , CHEMISTRY , CHEWING_GUM_LOLIPOPS \n CHIPS_FLAKES , CIGARETTES , COFFEE TEA \n DAIRY_CHESSE , DRINK_JUICE , GENERAL , GENERAL_FOOD \n GENERAL_ITEMS , GROATS_RICE_PASTA , ICE_CREAMS_FROZEN, KETCH_CONCETRATE_MUSTARD_MAJO_HORSERADISH \n OCCASIONAL , POULTRY , SPICES , SWEETS , TABLETS , VEGETABLES") |
This file contains hidden or 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
| from datetime import datetime , timedelta | |
| import pandas as pd | |
| import numpy as np | |
| import matplotlib.pyplot as plt | |
| from pycaret.regression import * | |
| import requests | |
| from wwo_hist import retrieve_hist_data | |
| date=(input("enter the month and year for which you want to predict the sales of the product [EXAMPLE : 02-2020 (FEB 2020)]: ")) | |
| print("The Products are : \n ALCOHOL , BREAD , CHEMISTRY , CHEWING_GUM_LOLIPOPS \n CHIPS_FLAKES , CIGARETTES , COFFEE TEA \n DAIRY_CHESSE , DRINK_JUICE , GENERAL , GENERAL_FOOD \n GENERAL_ITEMS , GROATS_RICE_PASTA , ICE_CREAMS_FROZEN, KETCH_CONCETRATE_MUSTARD_MAJO_HORSERADISH \n OCCASIONAL , POULTRY , SPICES , SWEETS , TABLETS , VEGETABLES") |
This file contains hidden or 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 | |
| from flask import Flask, request, jsonify, render_template | |
| import pickle | |
| from datetime import datetime , timedelta | |
| import pandas as pd | |
| import pycaret | |
| import requests | |
| from wwo_hist import retrieve_hist_data | |
| from pycaret.regression import * | |
| import matplotlib.pyplot as plt |
This file contains hidden or 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
| from importlib import import_module | |
| import os | |
| import jsonpickle | |
| from flask import Flask,Response , request , flash , url_for,jsonify | |
| import logging | |
| from logging.config import dictConfig | |
| import numpy as np | |
| from PIL import Image | |
| from tensorflow.keras.models import load_model | |
| from tensorflow.keras.preprocessing.image import load_img, img_to_array |
This file contains hidden or 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 cv2 | |
| import h5py | |
| import matplotlib.pyplot as plt | |
| from tensorflow.keras.preprocessing import image | |
| from tensorflow.keras.models import load_model | |
| IMG_SIZE=224 | |
| model = load_model('/home/soumi/Downloads/best1.h5') | |
NewerOlder