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
| #TESTING | |
| max_seq_length = 128 #This number will determine the number of tokens | |
| #An example for tokenization | |
| s1 = train['STORY'].iloc[0] | |
| stokens1 = tokenizer.tokenize(s1) | |
| stokens1 = ["[CLS]"] + stokens1 + ["[SEP]"] | |
| input_ids1 = get_ids(stokens1, tokenizer, max_seq_length) | |
| input_masks1 = get_masks(stokens1, max_seq_length) |
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
| self.args = { | |
| "output_dir": "outputs/", | |
| "cache_dir": "cache_dir/", | |
| "fp16": True, | |
| "fp16_opt_level": "O1", | |
| "max_seq_length": 128, | |
| "train_batch_size": 8, | |
| "gradient_accumulation_steps": 1, | |
| "eval_batch_size": 8, | |
| "num_train_epochs": 1, |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| <!DOCTYPE html> | |
| <html > | |
| <!--From https://codepen.io/frytyler/pen/EGdtg--> | |
| <head> | |
| <meta charset="UTF-8"> | |
| <title>Find The Resale Price Of Your Car Now!!</title> | |
| <meta name="viewport" content="width=device-width, initial-scale=1"> | |
| <link href='https://fonts.googleapis.com/css?family=Pacifico' rel='stylesheet' type='text/css'> | |
| <link rel="stylesheet" href="https://fonts.googleapis.com/css?family=Raleway"> | |
| <link rel="stylesheet" href="https://www.w3schools.com/w3css/4/w3.css"> |
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
| #Importing necessary packages | |
| import numpy as np | |
| from flask import Flask, request, render_template | |
| import pickle | |
| from fastai.tabular import * | |
| import os | |
| #Saving the working directory and model directory | |
| cwd = os.getcwd() | |
| path = cwd + '/model' |
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
| #Importing necessary packages | |
| import numpy as np | |
| from flask import Flask, request, render_template | |
| import pickle | |
| from fastai.tabular import * | |
| import os |
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
| def predict(): | |
| try: | |
| #all the input labels . We had only trained the model using these selected features. | |
| labels = ['Brand', 'Location', 'Year', 'Kilometers_Driven', 'Fuel_Type','Transmission', 'Owner_Type', 'Mileage'] | |
| #Collecting values from the html form and converting into respective types as expected by the model | |
| Brand = request.form["Brand"] | |
| Location = request.form["Location"] | |
| Year = int(request.form["Year"]) |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
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
| #Importing the speech recognition module | |
| import speech_recognition as sr | |
| #A random default value for prediction -- not among the classes we are predicting | |
| prediction = 10 | |
| #Initializing the speech recognizer | |
| r = sr.Recognizer() | |
| #Declaring the listener source | |
| with sr.Microphone() as source: |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.