How to use from the
Use from the
Transformers library
# Use a pipeline as a high-level helper
# Warning: Pipeline type "translation" is no longer supported in transformers v5.
# You must load the model directly (see below) or downgrade to v4.x with:
# 'pip install "transformers<5.0.0'
from transformers import pipeline

pipe = pipeline("translation", model="qiyuw/WSPAlign-mbert-base")
# Load model directly
from transformers import AutoTokenizer, AutoModelForQuestionAnswering

tokenizer = AutoTokenizer.from_pretrained("qiyuw/WSPAlign-mbert-base")
model = AutoModelForQuestionAnswering.from_pretrained("qiyuw/WSPAlign-mbert-base", device_map="auto")
Quick Links

Model Description

Refer to https://github.com/qiyuw/WSPAlign and https://github.com/qiyuw/WSPAlign.InferEval for details.

Qucik Usage

First clone inference repository:

git clone https://github.com/qiyuw/WSPAlign.InferEval.git

Then install the requirements following https://github.com/qiyuw/WSPAlign.InferEval. For inference only transformers, SpaCy and torch are required.

Finally, run the following example:

python inference.py --model_name_or_path qiyuw/WSPAlign-ft-kftt --src_lang ja --src_text="私は猫が好きです。" --tgt_lang en --tgt_text="I like cats."

Check inference.py for details usage.

Citation

Cite our paper if WSPAlign helps your work:

@inproceedings{wu-etal-2023-wspalign,
    title = "{WSPA}lign: Word Alignment Pre-training via Large-Scale Weakly Supervised Span Prediction",
    author = "Wu, Qiyu  and Nagata, Masaaki  and Tsuruoka, Yoshimasa",
    booktitle = "Proceedings of the 61st Annual Meeting of the Association for Computational Linguistics (Volume 1: Long Papers)",
    month = jul,
    year = "2023",
    address = "Toronto, Canada",
    publisher = "Association for Computational Linguistics",
    url = "https://aclanthology.org/2023.acl-long.621",
    pages = "11084--11099",
}
Downloads last month
97
Inference Providers NEW
This model isn't deployed by any Inference Provider. 🙋 Ask for provider support