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
<LineChart | |
width={500} | |
height={300} | |
data={data} | |
margin={{ | |
top: 5, right: 30, left: 20, bottom: 5, | |
}} | |
> | |
<CartesianGrid strokeDasharray="3 3" /> | |
<XAxis dataKey="name" /> |
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
<ResponsiveLine | |
data={data} | |
margin={{ top: 50, right: 110, bottom: 50, left: 60 }} | |
xScale={{ type: 'point' }} | |
yScale={{ type: 'linear', min: 'auto', max: 'auto', stacked: true, reverse: false }} | |
axisTop={null} | |
axisRight={null} | |
axisBottom={{ | |
orient: 'bottom', | |
tickSize: 5, |
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
Select.propTypes = { | |
children: (props, propName, componentName) => { | |
let error; | |
const prop = props[propName]; | |
React.Children.forEach(prop, (child) => { | |
// type.name seems to work for both Class and Functional components | |
if (child.type.name !== 'Option') { | |
error = new Error(`\`${componentName}\` only accepts children of type \`Option\`.`,); | |
} | |
}); |
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
import tensorflow as tf | |
import tensorflow_hub as hub | |
import numpy as np | |
import os, sys | |
from sklearn.metrics.pairwise import cosine_similarity | |
# get cosine similairty matrix | |
def cos_sim(input_vectors): | |
similarity = cosine_similarity(input_vectors) | |
return similarity |
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
import nltk | |
from nltk.stem import WordNetLemmatizer | |
from nltk.corpus import wordnet | |
lemmatizer = WordNetLemmatizer() | |
# function to convert nltk tag to wordnet tag | |
def nltk_tag_to_wordnet_tag(nltk_tag): | |
if nltk_tag.startswith('J'): | |
return wordnet.ADJ |
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
export const asyncApiCall = (values) => { | |
return async dispatch => { | |
try { | |
const response = await axios.get(url); | |
dispatch(successHandle(response)); | |
} | |
catch(error) { | |
dispatch(errorHandle(error)); | |
} |
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
export const asyncApiCall = (values) => { | |
return dispatch => { | |
return axios.get(url) | |
.then(response =>{ | |
dispatch(successHandle(response)); | |
}) | |
.catch(error => { | |
dispatch(errorHandle(error)); | |
}); | |
} |