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
### Prep data | |
import json | |
import csv | |
import uuid | |
import random | |
# Initialize the dictionaries | |
train_queries = {} | |
train_corpus = {} | |
train_relevant_docs = {} | |
val_queries = {} # New validation datasets |
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
https://jsbin.com/kupoxasizo/1/edit?js,output | |
https://jsbin.com/naxuzibuco/1/edit?js,output | |
https://jsbin.com/modipeduxu/1/edit?js,output |
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
https://jsbin.com/qiriti/edit?js,console | |
https://jsbin.com/rumuwus/edit?js,console | |
https://jsbin.com/conome/edit?js,output |
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
https://jsbin.com/culaga/edit?js,console | |
https://jsbin.com/xavedoh/edit?js,console | |
https://jsbin.com/xisabod/edit?js,console | |
https://jsbin.com/rizicon/edit?js,console |
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
What is scope? Your explanation should include the idea of global vs. local scope. | |
Local scope is inside a function, global would be outside of it where variable will be used throughout the code. | |
Why are global variables avoided? | |
Global variables should be avoided as the can interfere with other variable that is used in the local scope, it might as well iterfere with other varables in local scope throught all js file defined. | |
Explain JavaScript's strict mode | |
It doesnt allow any global variables to be created. | |
What are side effects, and what is a pure function? |
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
https://jsbin.com/valiva/edit?js,console | |
https://jsbin.com/sedesub/edit?js,console | |
https://jsbin.com/pecasu/edit?js,console |
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
https://jsbin.com/vipuzi/edit?html,js,output | |
https://jsbin.com/tafufor/edit?html,js,output | |
https://jsbin.com/visixox/edit?html,js,console,output | |
https://jsbin.com/kisine/edit?html,js,console,output | |
https://jsbin.com/pekawu/edit?js,console | |
https://jsbin.com/zojeyiv/edit?js,console |
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
https://jsbin.com/qovedap/edit?html,js,output | |
https://jsbin.com/yohidu/edit?html,css,js,output |
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
https://jsbin.com/raberul/edit?html,js,console | |
https://jsbin.com/qukuca/edit?html,js,console | |
https://jsbin.com/hezada/edit?html,js,console |
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
https://jsbin.com/yatoreg/edit?html,js,output | |
https://jsbin.com/pigunug/edit?html,js,output | |
http://jsbin.com/kojeku/edit?html,js,console |