Salesforce / discord_qg

huggingface.co
Total runs: 7
24-hour runs: 0
7-day runs: 1
30-day runs: -6
Model's Last Updated: January 15 2025
text2text-generation

Introduction of discord_qg

Model Details of discord_qg

Model card for the Question Generation component of the Discord Questions paper (EMNLP 2022 - Findings). The model is a finetuned BART-large, and can be used with the following command:

from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

dqg_tokenizer = AutoTokenizer.from_pretrained("Salesforce/discord_qg")
discord_qg = AutoModelForSeq2SeqLM.from_pretrained("Salesforce/discord_qg")

paragraph = "The International Monetary Fund warned on Tuesday that colliding pressures from inflation, war-driven energy and food crises and sharply higher interest rates were pushing the world to the brink of recession and threatening financial market stability."

encoder_ids = dqg_tokenizer.batch_encode_plus([paragraph], add_special_tokens=True, return_tensors="pt")
model_output = discord_qg.generate(**encoder_ids)

generated_texts = dqg_tokenizer.batch_decode(model_output, skip_special_tokens=True)
print(generated_texts) #  ['When was the last time the IMF warned of a global recession?']

The model has a tendency to generate "When " questions. If you would rather generate other questions you can do the following:

from transformers import AutoTokenizer, AutoModelForSeq2SeqLM

qg_tokenizer = AutoTokenizer.from_pretrained("Salesforce/discord_qg")
qg_model = AutoModelForSeq2SeqLM.from_pretrained("Salesforce/discord_qg")

paragraph = "The International Monetary Fund warned on Tuesday that colliding pressures from inflation, war-driven energy and food crises and sharply higher interest rates were pushing the world to the brink of recession and threatening financial market stability."

for start_word in ["How", "Why"]:
    encoder_ids = qg_tokenizer.batch_encode_plus([paragraph], add_special_tokens=True, padding=True, truncation=True, return_tensors="pt")
    decoder_input_ids = qg_tokenizer.batch_encode_plus([start_word], add_special_tokens=True, return_tensors="pt")["input_ids"][:, :-1]
    model_output = qg_model.generate(**encoder_ids, decoder_input_ids=decoder_input_ids, max_length=20)
    generated_questions = qg_tokenizer.batch_decode(model_output, skip_special_tokens=True)

    print(generated_questions)

Prints:

['How will the global economy be affected?']
['Why was the IMF warning?']

Runs of Salesforce discord_qg on huggingface.co

7
Total runs
0
24-hour runs
0
3-day runs
1
7-day runs
-6
30-day runs

More Information About discord_qg huggingface.co Model

More discord_qg license Visit here:

https://choosealicense.com/licenses/apache-2.0

discord_qg huggingface.co

discord_qg huggingface.co is an AI model on huggingface.co that provides discord_qg's model effect (), which can be used instantly with this Salesforce discord_qg model. huggingface.co supports a free trial of the discord_qg model, and also provides paid use of the discord_qg. Support call discord_qg model through api, including Node.js, Python, http.

Salesforce discord_qg online free

discord_qg huggingface.co is an online trial and call api platform, which integrates discord_qg's modeling effects, including api services, and provides a free online trial of discord_qg, you can try discord_qg online for free by clicking the link below.

Salesforce discord_qg online free url in huggingface.co:

https://huggingface.co/Salesforce/discord_qg

discord_qg install

discord_qg is an open source model from GitHub that offers a free installation service, and any user can find discord_qg on GitHub to install. At the same time, huggingface.co provides the effect of discord_qg install, users can directly use discord_qg installed effect in huggingface.co for debugging and trial. It also supports api for free installation.

discord_qg install url in huggingface.co:

https://huggingface.co/Salesforce/discord_qg

Url of discord_qg

Provider of discord_qg huggingface.co

Salesforce
ORGANIZATIONS

Other API from Salesforce

huggingface.co

Total runs: 41.7K
Run Growth: -9.1K
Growth Rate: -21.92%
Updated: January 21 2025
huggingface.co

Total runs: 8.5K
Run Growth: 1.2K
Growth Rate: 15.14%
Updated: February 19 2024
huggingface.co

Total runs: 3.3K
Run Growth: 1.1K
Growth Rate: 32.37%
Updated: January 25 2025
huggingface.co

Total runs: 586
Run Growth: 510
Growth Rate: 87.03%
Updated: January 21 2025
huggingface.co

Total runs: 542
Run Growth: 265
Growth Rate: 46.01%
Updated: January 21 2025
huggingface.co

Total runs: 290
Run Growth: -31
Growth Rate: -12.02%
Updated: January 15 2025
huggingface.co

Total runs: 50
Run Growth: -58
Growth Rate: -116.00%
Updated: January 15 2025