Code Monkey home page Code Monkey logo

Comments (10)

jeffchy avatar jeffchy commented on May 24, 2024

Hi, could you please provide more details about this issue? e.g., the config file you run, the environments, and screenshots. These will help us find the problem, thanks.

from adaseq.

averieso avatar averieso commented on May 24, 2024

Please see below for the config file (only the source and target emb files are changed according to the instruction). I'm not sure what information I should provide regarding the environment (except pip freeze above) and screenshots? Thanks.

config file:
experiment:
exp_dir: experiments/
exp_name: ufet
seed: 17

task: entity-typing

dataset:
data_file:
train: 'https://www.modelscope.cn/api/v1/datasets/izhx404/ufet/repo/files?Revision=master&FilePath=train.json'
valid: 'https://www.modelscope.cn/api/v1/datasets/izhx404/ufet/repo/files?Revision=master&FilePath=dev.json'
test: 'https://www.modelscope.cn/api/v1/datasets/izhx404/ufet/repo/files?Revision=master&FilePath=test.json'
tokenizer: blank
lower: true
labels: 'https://www.modelscope.cn/api/v1/datasets/izhx404/ufet/repo/files?Revision=master&FilePath=labels.txt'

preprocessor:
type: multilabel-concat-typing-preprocessor
model_dir: roberta-large
max_length: 150

data_collator: MultiLabelConcatTypingDataCollatorWithPadding

model:
type: multilabel-concat-typing-model
embedder:
model_name_or_path: roberta-large
drop_special_tokens: false
dropout: 0
decoder:
type: pairwise-crf
label_emb_type: glove
label_emb_dim: 300
source_emb_file_path: None
target_emb_dir: /home/averie/name-entity-recognition/experiments/adaseq/glove_embeds # TODO
target_emb_name: glove.300.emb
pairwise_factor: 70
mfvi_iteration: 4
two_potential: false
sign_trick: true
loss_function: WBCE
pos_weight: 4

train:
max_epochs: 30
dataloader:
batch_size_per_gpu: 4
optimizer:
type: AdamW
lr: 2.0e-5
lr_scheduler:
type: cosine
warmup_rate: 0.1 # when choose concat typing model, default to use cosine_linear_with_warmup
options:
by_epoch: false
hooks:
- type: "CheckpointHook"
interval: 100
- type: "BestCkptSaverHook"
save_file_name: "best_model.pt"

evaluation:
dataloader:
batch_size_per_gpu: 32
metrics: typing-metric

from adaseq.

jeffchy avatar jeffchy commented on May 24, 2024

could you successfully run the default npcrf example?

from adaseq.

averieso avatar averieso commented on May 24, 2024

how do i run the default example? it requires PATH_TO_DIR to be replaced, which is what I did.

from adaseq.

jeffchy avatar jeffchy commented on May 24, 2024
decoder:
  type: pairwise-crf
  label_emb_type: glove
  label_emb_dim: 300
  source_emb_file_path: ${PATH_TO_DIR}/glove.6B.300d.txt
  target_emb_dir: ${PATH_TO_DIR}  # TODO
  target_emb_name: glove.300.emb
  pairwise_factor: 70
  mfvi_iteration: 4
  two_potential: false
  sign_trick: true

It seems that your configuration is incorrect, the above shows the default configuration. The glove path can be downloaded from the official stanford website: https://nlp.stanford.edu/data/glove.6B.zip.
The source_emb_file_path should be the absolute path to for example the glove.6B.300d.txt, and the target_emb_dir, is the directory that you want to store the label embedding matrix named with target_emb_name.
In other word, the label embedding is preprocessed from ${YOUR_SRC_EMB_DIR}/glove.6B.300d.txt, and saved to ${YOUR_TGT_EMB_SAVE_DIR}/glove.300.emb

from adaseq.

averieso avatar averieso commented on May 24, 2024

thank you for your answer. according to the readme in the NPCRF directory:

"NPCRF requires static label embeddings, the preprocessed label embeddings (from GloVe for EN, Tencent for ZH) can be downloaded here: UFET, CFET, and you can place them in yoru folder and run the following config: (you need to reset your target_emb_dir in the config). Or you can provide the path of the glove embedding file (e.g., /path/to/your/glove.6B.300d.txt) and the code will generate label embedding for you."

so i cannot use the glove.300.emb given in this description?

from adaseq.

jeffchy avatar jeffchy commented on May 24, 2024

Could you please give a screenshot of the error message?
And, can you successfully run the model when you create embedding from the glove source?

from adaseq.

averieso avatar averieso commented on May 24, 2024
Screenshot 2023-06-05 at 16 11 34

I just tried the glove source, it resulted in the same error (see screenshot)

from adaseq.

jeffchy avatar jeffchy commented on May 24, 2024

oops, it seems that the bug is caused by the latest update of adaseq in the typing metric. No problem occurs in the training and loading label embeddings, a quick fix could be downgrading the adaseq to 0.6.2 and modelscope to 1.4.2.
We will fix the bug later.

from adaseq.

averieso avatar averieso commented on May 24, 2024

thanks for the reply. i did pip install adaseq==0.6.2 and pip install modelscope==1.4.2 but still getting the same error. am I missing something?

from adaseq.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.