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
| import streamlit as st | |
| import numpy as np | |
| from lmproof.scorer import TransformerLMScorer | |
| from lmproof.candidate_generators import (MatchedGenerator, | |
| EnglishInflectedGenerator, | |
| SpellCorrectGenerator) | |
| @st.cache(ignore_hash=True) | |
| def 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
| from collections import namedtuple | |
| from typing import Any, List, Iterator, Tuple | |
| import torch | |
| import copy | |
| class FairseqHubInferer: | |
| """ |
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
| pip install git+https://github.com/sai-prasanna/spacy-pattern-builder.git | |
| pip install streamlit | |
| python -m spacy download en # Or any other model you wish to use. | |
| streamlit run streamlit_pattern_builder.py |
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
| import tensorflow as tf #We need tensorflow 2.x | |
| import numpy as np | |
| #The hashlength in bits | |
| hashLength = 256 | |
| def buildModel(): | |
| #we can set the seed to simulate the fact that this network is known and doesn't change between runs | |
| #tf.random.set_seed(42) | |
| model = tf.keras.Sequential() |
OlderNewer