Skip to content

Instantly share code, notes, and snippets.

View mohdsanadzakirizvi's full-sized avatar

Mohd Sanad Zaki Rizvi mohdsanadzakirizvi

View GitHub Profile
@mohdsanadzakirizvi
mohdsanadzakirizvi / basic_regression.js
Last active March 23, 2021 23:14
Tensorflow.js demo
const callbacks = {
onEpochEnd: async (epoch, logs) => {
console.log("epoch: " + epoch + JSON.stringify(logs))
}
};
// Generate some synthetic data for training.
const xs = tf.tensor2d([[1], [2], [3], [4]], [4, 1]);
const ys = tf.tensor2d([[1], [3], [5], [7]], [4, 1]);
## intent:current_matches
- which cricket match is happening right now
- which ipl match is next
- which teams are playing next in ipl
- tell me some ipl news
- i want ipl updates
- what are the latest match updates
- who won the last ipl match
- how is ipl going
- what was the result of the last match
{
'intent': {
'name': 'current_matches',
'confidence': 0.6657130383645372
},
'entities': [],
'intent_ranking': [{
'name': 'current_matches',
'confidence': 0.6657130383645372
}, {
Me: Hi
Iplbot: Hey! How may I help you?
Me: What was the result of the last match?
Iplbot: Here are some IPL quick info:
1.The match between Rajasthan Royals and Delhi Capitals was recently held and Delhi Capitals won.
2.The next match is Warriors vs Titans on 22 April 2019
## news path 1
* greet
- utter_greet
* current_matches
- action_match_news
- utter_did_that_help
* affirm or thanks
- utter_gratitude
* goodbye
- utter_goodbye
## news path 1
* greet
- utter_greet
* current_matches
- action_match_news
- utter_did_that_help
* affirm or thanks
- utter_gratitude
* goodbye
- utter_goodbye
policies:
- name: KerasPolicy
epochs: 100
max_history: 5
- name: FallbackPolicy
fallback_action_name: 'action_default_fallback'
- name: MemoizationPolicy
max_history: 5
API_URL = "https://cricapi.com/api/"
API_KEY = ""
class ApiAction(Action):
def name(self):
return "action_match_news"
def run(self, dispatcher, tracker, domain):
res = requests.get(API_URL + "matches" + "?apikey=" + API_KEY)
if res.status_code == 200:
actions:
- utter_greet
- utter_did_that_help
- utter_goodbye
- action_match_news
- utter_default
- utter_gratitude
- utter_ask_again
intents:
<!DOCTYPE html>
<html>
<head>
<meta charset="UTF-8">
<meta http-equiv="X-UA-Compatible" content="IE=edge">
<meta name="viewport" content="width=device-width, initial-scale=1">
<!-- title of the page -->
<title>image_classification</title>
<!-- load processing library-->
<script src="https://cdnjs.cloudflare.com/ajax/libs/p5.js/0.8.0/p5.min.js"></script>