gt4sd / zero-shot-bert-adapters Goto Github PK
View Code? Open in Web Editor NEWImplementation of Z-BERT-A: a zero-shot pipeline for unknown intent detection.
Home Page: https://arxiv.org/abs/2208.07084
License: MIT License
Implementation of Z-BERT-A: a zero-shot pipeline for unknown intent detection.
Home Page: https://arxiv.org/abs/2208.07084
License: MIT License
Getting this error after a clean install and running sample Jupyter Notebook. On macOS, using vscode in anaconda environment. Happens after running the cell beginning with "model_name = "
The model link you provided cannot be accessed at all? Can you directly feed the model into the code? Or explain what kind of pre trained model is useless? Thank you.
Since the method is used also in the example, I would consider removing the prepended _
.
After installing all I run the example
model_name = "bert-base-uncased"
device = torch.device('cuda' if torch.cuda.is_available() else 'cpu')
berta = model.instantiate_model(2, 2, device, model_name,
{"entailment": 0, "contradiction": 1}, path="model.pt", dict=True)
and I get error
AttributeError: 'BertModel' object has no attribute 'add_adapter'
Python version: Python 3.10.6
OS Version: `MacOS Monterey 12.6'
I tried to install the package on a clean env using the following commands:
poetry add git+https://github.com/GT4SD/zberta.git
and
poetry add git+ssh://[email protected]/github.com/GT4SD/zberta.git
and I getting the following error:
CalledProcessError
Command '['git', 'clone', '--recurse-submodules', '--', 'ssh://[email protected]/github.com/GT4SD/zberta.git', '/var/folders/5t/lgg8r5ws1xbdm8pp6kh37ytm0000gn/T/pypoetry-git-zbertaeirek49a']' returned non-zero exit status 128.
at /usr/local/Cellar/poetry/1.1.15/libexec/lib/python3.10/site-packages/poetry/utils/_compat.py:217 in run
213│ process.wait()
214│ raise
215│ retcode = process.poll()
216│ if check and retcode:
→ 217│ raise CalledProcessError(
218│ retcode, process.args, output=stdout, stderr=stderr
219│ )
220│ finally:
221│ # None because our context manager __exit__ does not use them.
python version: 3.9
& 3.10
os version: MacOS Monterey 12.6
poetry version: 1.1.15
Hi @comidan, Thanks again for making this pipeline open-source.
I have two concerns.
Whether the model is using both datasets (SNLI and Banking77-OOS) or it’s only using SNLI for the training? if yes, then can you please point out where and how is it used in the code?
It is related to the 1st one as well. Actually, I need to train the BERT-A model with any other dataset other than Banking77-OOS to generate unknown intents. Can you please guide me on how to do that?
---> 15 z_intents = unknown_intents_set("en_core_web_trf", z_dataset['test']['text'])
16 berta = model.instantiate_model(z_banking.labels(), z_banking.output_dim(), device, model_name,
17 z_banking.nli_labels(), path="model.pt", dict=True)
/usr/local/lib/python3.7/dist-packages/zberta/intent_discovery/unknown_intents.py in unknown_intents_set(dataset, spacy_model)
15 def unknown_intents_set(dataset, spacy_model=None):
16 global nlp_engine
---> 17 if spacy_model is not None and spacy_model not in default_spacy:
18 os.system("python -m spacy download " + spacy_model + " --no-deps")
19 nlp_engine = spacy.load(spacy_model)
TypeError: 'in ' requires string as left operand, not list
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.