stanford-oval/wikidata-emnlp23 hiện có 102 sao trên GitHub, viết chủ yếu bằng Python. WikiSP, a semantic parser for Wikidata. WikiWebQuestions, a SPARQL-annotated dataset on Wikidata
Tóm tắt dựng từ metadata GitHub của chính dự án — chưa có bài review TopGit. Trang sẽ tự động cập nhật khi bài review đầy đủ được xuất bản.
VÌ SAO CHƯA CÓ REVIEW
TopGit viết bài đầy đủ cho repo có nhiều sao nhất và được yêu cầu nhiều nhất. Trang này là snapshot trong thời gian chờ — xem README gốc ở tab READ ME.
[2024-10] 🚀 Check out our follow-up work in Findings of EMNLP 2024 (paper) at repo. You can also interact with the online agent here.
Repo structure
The WikiWebQuestions dataset can be found under directory WikiWebQuestions;
Training data for all models published in our paper can be found under directory training_data;
Prediction results for all models published in our paper can be found under directory predicted_results.
Published WikiSP (LLaMA) models
Two models in the paper are available on huggingface:
https://huggingface.co/stanford-oval/llama-7b-wikiwebquestions: This model is trained on WikiWebquestions and the Stanford Alpaca dataset. In the paper, this is the WikiSP (ours) model in Section 6 tables.
https://huggingface.co/stanford-oval/llama-7b-wikiwebquestions-qald7: This model is trained on both WikiWebquestions, Qald-7, and the Stanford Alpaca dataset. In the paper, this is the model in Section 7.
Then, start the server in a separate terminal using Huggingface's text-generation-inference library. We recommend using their provided Docker image given its ease of use. Run:
docker run --gpus all --shm-size 1g -p 8700:80 -v <PATH_TO_LOCAL_DIRECTORY>:/data ghcr.io/huggingface/text-generation-inference:1.3.4 --model-id /data/ --num-shard <number-of-gpus> --max-batch-total-tokens 4096
(for instance, this would set up a connection on "http://127.0.0.1:8700/" for inference)
Model training data names
The JSON file names correspond to the models in our paper in the following way:
best refers to the best model in our paper, i.e., WikiSP (ours) in Section 6 tables;
no_mention_oracle refers to the model named No mentions, trained with Oracle NED in Section 6.2 (Table 2);
no_mention_refined refers to the model named No mentions, trained with ReFinED in Section 6.2 (Table 2);
original_query_format refers to the model named Original SPARQL in Section 6.3 (Table 3).
Evaluation
To run evaluation on the dev set, prepare your prediction file in the same format as predicted_results/best.json, and supply it as the first parameter
for execute_predictions("predicted_results/best.json", "WikiWebQuestions/dev.json") in eval_predictions.py.
Then, run python eval_predictions.py.
If running on the test set, also change the second parameter to "WikiWebQuestions/test.json"
Models & Inference
evaluate_dev under eval.py specifies how to evaluate our model on the dev set. To inference, first inject wikidata-emnlp23/WikiWebQuestions/dev.json into
a MongoDB (in eval.py this corresponds to webquestion_dev = client["wikidata-eval"]["dev"]).
and then run do_ned_for_dev under eval.py to inference all entities in the dev set (change /data0/wikidata-workdir/models/refined there to <your_directory>).
Perform inference
Run evaluate_dev to get results on the dev set.
Citation
If you have used data or code from this repository, please cite this paper:
@inproceedings{xu-etal-2023-fine,
title = "Fine-tuned {LLM}s Know More, Hallucinate Less with Few-Shot Sequence-to-Sequence Semantic Parsing over {W}ikidata",
author = "Xu, Silei and
Liu, Shicheng and
Culhane, Theo and
Pertseva, Elizaveta and
Wu, Meng-Hsi and
Semnani, Sina and
Lam, Monica",
editor = "Bouamor, Houda and
Pino, Juan and
Bali, Kalika",
booktitle = "Proceedings of the 2023 Conference on Empirical Methods in Natural Language Processing",
month = dec,
year = "2023",
address = "Singapore",
publisher = "Association for Computational Linguistics",
url = "https://aclanthology.org/2023.emnlp-main.353",
pages = "5778--5791",
abstract = "While large language models (LLMs) can answer many questions correctly, they can also hallucinate and give wrong answers. Wikidata, with its over 12 billion facts, can be used to ground LLMs to improve their factuality. This paper presents WikiWebQuestions, a high-quality question answering benchmark for Wikidata. Ported over from WebQuestions for Freebase, it consists of real-world data with SPARQL annotation. This paper presents a few-shot sequence-to-sequence semantic parser for Wikidata. We modify SPARQL to use the unique domain and property names instead of their IDs. We train the parser to use either the results from an entity linker or mentions in the query. We fine-tune LLaMA by adding the few-shot training data to that used to fine-tune Alpaca. Our experimental results demonstrate the effectiveness of this methodology, establishing a strong baseline of 76{\%} and 65{\%} answer accuracy in the dev and test sets of WikiWebQuestions, respectively. By pairing our semantic parser with GPT-3, we combine verifiable results with qualified GPT-3 guesses to provide useful answers to 96{\%} of the questions in dev. We also show that our method outperforms the state-of-the-art for the QALD-7 Wikidata dataset by 3.6{\%} in F1 score.",
}
Trang TopGit này là một snapshot — tab "Readme" hiển thị nguyên văn README của repo (đã bỏ link, giữ ảnh). Repo GitHub ở github.com/stanford-oval/wikidata-emnlp23 là nguồn chính thức.
stanford-oval/wikidata-emnlp23 có phải mã nguồn mở không?
TopGit chưa ghi nhận license cho stanford-oval/wikidata-emnlp23. Phần lớn repo public trên GitHub là mã nguồn mở, nhưng điều khoản khác nhau từng repo — mở file LICENSE để xác nhận.
stanford-oval/wikidata-emnlp23 có tag gì không?
Bản đồng bộ chưa ghi nhận topic GitHub nào cho stanford-oval/wikidata-emnlp23. GitHub topics hiển thị ở thanh bên phải trang repo — đó là nơi đáng kiểm tra nhất.
stanford-oval/wikidata-emnlp23 có trang demo không?
Dự án có trang chủ ở https://arxiv.org/abs/2305.14202. Tab "Readme" ở trang này thường có ảnh chụp và hướng dẫn bắt đầu nhanh.
stanford-oval/wikidata-emnlp23 còn đang phát triển không?
Commit gần nhất trên stanford-oval/wikidata-emnlp23 là 1.1 năm trước (theo timestamp GitHub). Repo có 10 fork — một chỉ báo về mức độ quan tâm của cộng đồng.
Đọc đầy đủ README ở tab phía trên.
Muốn nghe thêm một ý kiến về wikidata-emnlp23?
Hỏi một AI đọc được trang này — một cú bấm là có ngay nhận định về wikidata-emnlp23.