Skip to content

Instantly share code, notes, and snippets.

@app.route('/')
def index():
resp_dic = {'prediction': 2, 'confidence': 50, 'review_text': ""}
resp = jsonify(resp_dic)
resp.headers['Access-Control-Allow-Origin'] = '*'
return resp
@app.route('/analyze', methods=['POST'])
def analyze():
args.text = request.form['review_name']
@nikhilno1
nikhilno1 / index.html
Last active July 31, 2019 09:23
Messed up version
<html lang='en'>
<head>
<meta charset='utf-8'>
<link rel='stylesheet' href='../static/style.css'>
<link rel="stylesheet" href="../static/cmGauge.css">
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="../static/cmGauge.js"></script>
<link href="https://maxcdn.bootstrapcdn.com/bootstrap/3.4.0/css/bootstrap.min.css" rel="stylesheet">
<link href="../static/component-spinners.css" rel="stylesheet">
</head>
@nikhilno1
nikhilno1 / gauge.html
Created July 29, 2019 12:53
Attempt to use gauge jQuery plugin which is not working.
<!DOCTYPE html>
<html>
<head>
<script src="//code.jquery.com/jquery-2.1.1.min.js"></script>
<script src="//cdnjs.cloudflare.com/ajax/libs/raphael/2.1.2/raphael-min.js"></script>
<script src="kuma-gauge.jquery.js"></script>
</head>
<div class="js-gauge demo gauge"></div>
@nikhilno1
nikhilno1 / gist:a43988c4e4ff3c49c806e409080c8d79
Last active July 24, 2019 06:41
Code diff between run_dataset.py and run_glue.py
< """ Finetuning the library models for sequence classification on various datasets (Bert, XLM, XLNet)."""
---
> """ Finetuning the library models for sequence classification on GLUE (Bert, XLM, XLNet)."""
43c43
< from utils_dataset import (compute_metrics, convert_examples_to_features,
---
> from utils_glue import (compute_metrics, convert_examples_to_features,
177,178c177,178
< eval_task_names = (args.task_name,)
< eval_outputs_dirs = (args.output_dir,)
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.