Skip to content
Snippets Groups Projects
Commit 59962e7c authored by Albin Henriksson's avatar Albin Henriksson
Browse files

Fix small qol improvement in tokenizer.py and fix bug in sparql.ipynb

parent 90c052d3
No related branches found
No related tags found
No related merge requests found
%% Cell type:code id: tags:
``` python
from transformers import BartTokenizer, BartForConditionalGeneration
from transformers import Seq2SeqTrainer, Seq2SeqTrainingArguments
from transformers.models.bart.modeling_bart import shift_tokens_right
import datasets
import torch
import pandas as pd
import numpy as np
```
%% Cell type:code id: tags:
``` python
model = BartForConditionalGeneration.from_pretrained("facebook/bart-large")
tokenizer = BartTokenizer.from_pretrained("facebook/bart-large")
```
%% Output
loading configuration file config.json from cache at C:\Users\Albin/.cache\huggingface\hub\models--facebook--bart-large\snapshots\cb48c1365bd826bd521f650dc2e0940aee54720c\config.json
Model config BartConfig {
"activation_dropout": 0.1,
"activation_function": "gelu",
"add_bias_logits": false,
"add_final_layer_norm": false,
"architectures": [
"BartModel"
],
"attention_dropout": 0.1,
"bos_token_id": 0,
"classif_dropout": 0.1,
"classifier_dropout": 0.0,
"d_model": 1024,
"decoder_attention_heads": 16,
"decoder_ffn_dim": 4096,
"decoder_layerdrop": 0.0,
"decoder_layers": 12,
"decoder_start_token_id": 2,
"dropout": 0.1,
"early_stopping": true,
"encoder_attention_heads": 16,
"encoder_ffn_dim": 4096,
"encoder_layerdrop": 0.0,
"encoder_layers": 12,
"eos_token_id": 2,
"forced_bos_token_id": 0,
"forced_eos_token_id": 2,
"gradient_checkpointing": false,
"id2label": {
"0": "LABEL_0",
"1": "LABEL_1",
"2": "LABEL_2"
},
"init_std": 0.02,
"is_encoder_decoder": true,
"label2id": {
"LABEL_0": 0,
"LABEL_1": 1,
"LABEL_2": 2
},
"max_position_embeddings": 1024,
"model_type": "bart",
"no_repeat_ngram_size": 3,
"normalize_before": false,
"num_beams": 4,
"num_hidden_layers": 12,
"pad_token_id": 1,
"scale_embedding": false,
"task_specific_params": {
"summarization": {
"length_penalty": 1.0,
"max_length": 128,
"min_length": 12,
"num_beams": 4
},
"summarization_cnn": {
"length_penalty": 2.0,
"max_length": 142,
"min_length": 56,
"num_beams": 4
},
"summarization_xsum": {
"length_penalty": 1.0,
"max_length": 62,
"min_length": 11,
"num_beams": 6
}
},
"transformers_version": "4.23.1",
"use_cache": true,
"vocab_size": 50265
}
loading weights file pytorch_model.bin from cache at C:\Users\Albin/.cache\huggingface\hub\models--facebook--bart-large\snapshots\cb48c1365bd826bd521f650dc2e0940aee54720c\pytorch_model.bin
All model checkpoint weights were used when initializing BartForConditionalGeneration.
All the weights of BartForConditionalGeneration were initialized from the model checkpoint at facebook/bart-large.
If your task is similar to the task the model of the checkpoint was trained on, you can already use BartForConditionalGeneration for predictions without further training.
loading file vocab.json from cache at C:\Users\Albin/.cache\huggingface\hub\models--facebook--bart-large\snapshots\cb48c1365bd826bd521f650dc2e0940aee54720c\vocab.json
loading file merges.txt from cache at C:\Users\Albin/.cache\huggingface\hub\models--facebook--bart-large\snapshots\cb48c1365bd826bd521f650dc2e0940aee54720c\merges.txt
loading file added_tokens.json from cache at None
loading file special_tokens_map.json from cache at None
loading file tokenizer_config.json from cache at C:\Users\Albin/.cache\huggingface\hub\models--facebook--bart-large\snapshots\cb48c1365bd826bd521f650dc2e0940aee54720c\tokenizer_config.json
loading configuration file config.json from cache at C:\Users\Albin/.cache\huggingface\hub\models--facebook--bart-large\snapshots\cb48c1365bd826bd521f650dc2e0940aee54720c\config.json
Model config BartConfig {
"_name_or_path": "facebook/bart-large",
"activation_dropout": 0.1,
"activation_function": "gelu",
"add_bias_logits": false,
"add_final_layer_norm": false,
"architectures": [
"BartModel"
],
"attention_dropout": 0.1,
"bos_token_id": 0,
"classif_dropout": 0.1,
"classifier_dropout": 0.0,
"d_model": 1024,
"decoder_attention_heads": 16,
"decoder_ffn_dim": 4096,
"decoder_layerdrop": 0.0,
"decoder_layers": 12,
"decoder_start_token_id": 2,
"dropout": 0.1,
"early_stopping": true,
"encoder_attention_heads": 16,
"encoder_ffn_dim": 4096,
"encoder_layerdrop": 0.0,
"encoder_layers": 12,
"eos_token_id": 2,
"forced_bos_token_id": 0,
"forced_eos_token_id": 2,
"gradient_checkpointing": false,
"id2label": {
"0": "LABEL_0",
"1": "LABEL_1",
"2": "LABEL_2"
},
"init_std": 0.02,
"is_encoder_decoder": true,
"label2id": {
"LABEL_0": 0,
"LABEL_1": 1,
"LABEL_2": 2
},
"max_position_embeddings": 1024,
"model_type": "bart",
"no_repeat_ngram_size": 3,
"normalize_before": false,
"num_beams": 4,
"num_hidden_layers": 12,
"pad_token_id": 1,
"scale_embedding": false,
"task_specific_params": {
"summarization": {
"length_penalty": 1.0,
"max_length": 128,
"min_length": 12,
"num_beams": 4
},
"summarization_cnn": {
"length_penalty": 2.0,
"max_length": 142,
"min_length": 56,
"num_beams": 4
},
"summarization_xsum": {
"length_penalty": 1.0,
"max_length": 62,
"min_length": 11,
"num_beams": 6
}
},
"transformers_version": "4.23.1",
"use_cache": true,
"vocab_size": 50265
}
%% Cell type:code id: tags:
``` python
def encode(batch):
return tokenizer(batch, padding="max_length", max_length=256, return_tensors="pt")
def convert_to_features(example_batch):
input_encodings = encode(example_batch['text'])
target_encodings = encode(example_batch['summary'])
labels = target_encodings['input_ids']
decoder_input_ids = shift_tokens_right(labels, model.config.pad_token_id, model.config.decoder_start_token_id)
labels[labels[:, :] == model.config.pad_token_id] = -100
encodings = {
'input_ids': input_encodings['input_ids'],
'attention_mask': input_encodings['attention_mask'],
'decoder_input_ids': decoder_input_ids,
'labels': labels,
}
return encodings
def get_dataset(path):
df = pd.read_csv(path, sep=",", on_bad_lines='skip')
dataset = datasets.Dataset.from_pandas(df)
dataset = dataset.map(convert_to_features, batched=True)
columns = ['input_ids', 'labels', 'decoder_input_ids','attention_mask',]
dataset.set_format(type='torch', columns=columns)
return dataset
```
%% Cell type:code id: tags:
``` python
train_dataset = get_dataset("qald-9-train-linked-tokenized.csv")
train_dataset = get_dataset("combined-requeried-linked-train-tokenized-replace.csv")
test_dataset = get_dataset("test.csv")
```
%% Output
Parameter 'function'=<function convert_to_features at 0x0000011A8610D430> of the transform datasets.arrow_dataset.Dataset._map_single couldn't be hashed properly, a random hash was used instead. Make sure your transforms and parameters are serializable with pickle or dill for the dataset fingerprinting and caching to work. If you reuse this transform, the caching mechanism will consider it to be different from the previous calls and recompute everything. This warning is only showed once. Subsequent hashing failures won't be showed.
%% Cell type:code id: tags:
``` python
training_args = Seq2SeqTrainingArguments(
output_dir='./models/blackbox',
num_train_epochs=1,
per_device_train_batch_size=1,
per_device_eval_batch_size=1,
warmup_steps=10,
weight_decay=0.01,
logging_dir='./logs',
)
trainer = Seq2SeqTrainer(
model=model,
args=training_args,
train_dataset=train_dataset,
eval_dataset=test_dataset
)
```
%% Cell type:code id: tags:
``` python
#torch.cuda.empty_cache()
trainer.train()
```
%% Output
The following columns in the training set don't have a corresponding argument in `BartForConditionalGeneration.forward` and have been ignored: summary, text. If summary, text are not expected by `BartForConditionalGeneration.forward`, you can safely ignore this message.
c:\Users\Albin\AppData\Local\Programs\Python\Python39\lib\site-packages\transformers\optimization.py:306: FutureWarning: This implementation of AdamW is deprecated and will be removed in a future version. Use the PyTorch implementation torch.optim.AdamW instead, or set `no_deprecation_warning=True` to disable this warning
warnings.warn(
***** Running training *****
Num examples = 396
Num Epochs = 1
Instantaneous batch size per device = 1
Total train batch size (w. parallel, distributed & accumulation) = 1
Gradient Accumulation steps = 1
Total optimization steps = 396
Training completed. Do not forget to share your model on huggingface.co/models =)
{'train_runtime': 142.7742, 'train_samples_per_second': 2.774, 'train_steps_per_second': 2.774, 'train_loss': 1.3083391285905934, 'epoch': 1.0}
TrainOutput(global_step=396, training_loss=1.3083391285905934, metrics={'train_runtime': 142.7742, 'train_samples_per_second': 2.774, 'train_steps_per_second': 2.774, 'train_loss': 1.3083391285905934, 'epoch': 1.0})
%% Cell type:code id: tags:
``` python
prediction = trainer.predict([test_dataset[0]], max_length=256, num_beams=4)
```
%% Output
***** Running Prediction *****
Num examples = 1
Batch size = 1
%% Cell type:code id: tags:
``` python
for pred in prediction.predictions:
print(np.array(pred).shape)
print(tokenizer.batch_decode(torch.tensor(np.argmax(pred, axis=-1)))[0])
```
%% Output
(1, 256, 50265)
<s><s>AT: D:Salt?://sp:com/Salt_ ORDERVI (p:timetime://dbp.org/time res } DISTINCT?uri WHERE {?:Salt LakeLake_City d?://dbp.org/location?_timeZone } }uri }"?:?:( ( ((((((((((((((((((((((((((((((((((((stringstringstring(stringstringstringstringstringstringstring____(___(((___(((((((((__((((__((((____(((((((((((((((((((((((((((((((((((((_____(________________________________________________________
(1, 256, 1024)
says major major major major major major " " " major News major major major News major major major major major major major News major major major major News major News News News major major major major major major major major News major major major major major major major major says News major says says major major News News News major News News News News News News News News News major News News News News major News News News News News major News major major major major major News major major major major major major major major major major major major] says says says says says says says major major major major major major major major News News News News News News News News major News major says says says major major major major major says major says major major major News News News News News major News News News News News News News News News News News News News News News News News News News major major major major major major major major says says says says says says major News News News News major major major major major major major major major major major major major major major major major major major major major major major major major major major major major says major major major major major major major major major major major major major News News major News News News major News major major News major major a major major says major major says says says says says says says says
%% Cell type:code id: tags:
``` python
def to_query(sentence):
input = encode(sentence)
input.to('cuda')
predictions = model.generate(input['input_ids'], max_length=256, num_beams=20)
return tokenizer.batch_decode(predictions)
```
%% Cell type:code id: tags:
``` python
q = to_query("Who is barack obama?")
q
```
%% Output
['</s><s> "SELECT DISTINCT?uri WHERE { res:Barack_Obama dbo:leader?uri }"</s>']
%% Cell type:code id: tags:
``` python
import json
import csv
from tqdm import tqdm
pred = {}
pred["questions"] = []
with open("../data/qald-9-test.json", "r", encoding='utf-8') as f:
corr = json.load(f)
for i in tqdm(range(len(list(corr["questions"])))):
#Build the json predicted file
pred["questions"].append({"query": {"sparql" : to_query(corr["questions"][i]["question"][0]["string"])[0][7:-4]}})
json.dump(pred, open("pred.json", "w"))
```
%% Output
100%|██████████| 150/150 [01:43<00:00, 1.44it/s]
%% Cell type:code id: tags:
``` python
import csv
import json
prefixes = {
"res:": "http://dbpedia.org/resource/",
"dbo:": "http://dbpedia.org/ontology/",
"dbp:": "http://dbpedia.org/property/",
"rdfs:": "http://www.w3.org/2000/01/rdf-schema#",
"rdf:": "http://www.w3.org/1999/02/22-rdf-syntax-ns#",
"yago:": "http://dbpedia.org/class/yago/",
"wdt:": "http://www.wikidata.org/prop/direct/",
"wd:": "http://www.wikidata.org/entity/",
"p:": "http://www.wikidata.org/prop/",
"ps:": "https://w3id.org/payswarm#",
"pq:": "http://www.wikidata.org/prop/qualifier/",
"bd:": "http://www.bigdata.com/rdf#",
"wikibase:": "http://wikiba.se/ontology#",
"skos:": "http://www.w3.org/2004/02/skos/core#",
}
# Open test file and predict all queries, save to new csv file
TEST_FILE = "qald-9-test-linked-tokenized.csv"
TEST_FILE = "combined-requeried-linked-test-tokenized-replace.csv"
# JSON or CSV
TEST_FILE_IS_JSON = False
OUT_FILE = "qald-9-test-predictions.csv"
with open(TEST_FILE, "r", encoding="utf-8") as f, open(OUT_FILE, "w", encoding="utf-8") as out:
if TEST_FILE_IS_JSON:
test_data = json.load(f)
test_data = test_data["questions"]
test_data = [q["question"][0]["string"] for q in test_data]
else:
test_data = csv.reader(f, delimiter=",")
next(test_data)
test_data = list(test_data)
test_data = [q[0] for q in test_data]
for i, question in enumerate(test_data):
predicted = to_query(question)
predicted = predicted[0]
# Filter everything before the first " and after the last "
predicted = predicted[predicted.find('"') + 1:predicted.rfind('"')]
print(predicted)
# Replace all prefixes with their full URI
for prefix, uri in prefixes.items():
predicted = predicted.replace(f" {prefix}", f" {uri}")
# Find start of http://
start = predicted.find("http://")
# While there is still a http:// in the string
while start != -1:
# If there is a . after a / surround the . with spaces
next_slash = predicted.find("/", start + 8)
dot_after_slash = predicted.find(".", next_slash)
end = predicted.find(" ", start)
if dot_after_slash != -1 and predicted[dot_after_slash - 1] != " " and dot_after_slash < end:
# Add a space before the dot
predicted = predicted[:dot_after_slash] + " " + predicted[dot_after_slash:]
# Add a space after the dot
predicted = predicted[:dot_after_slash + 2] + " " + predicted[dot_after_slash + 2:]
# If there is a ?xxx after a / surround the ?xxx with spaces
next_question_mark = predicted.find("?", next_slash)
if next_question_mark != -1 and predicted[next_question_mark - 1] != " ":
# Add a space before the question mark
predicted = predicted[:next_question_mark] + " " + predicted[next_question_mark:]
# Find next space after start
end = predicted.find(" ", start)
# Place < and > around the URI
predicted = predicted[:start] + "<" + predicted[start:end] + ">" + predicted[end:]
# Find next http://
start = predicted.find("http://", end)
# Replace all http://ww. with http://www.
predicted = predicted.replace("http://ww.", "http://www.")
# While there is still a "http://http://" in the string replace it with "http://"
while predicted.find("http://http://") != -1:
predicted = predicted.replace("http://http://", "http://")
out.write(f"\"{question}\",\"{predicted}\"\n")
print(f"\"{question}\",\"{predicted}\"\n")
```
%% Output
SELECT DISTINCT?uri WHERE {?uri dbo:text?uri }
"text","SELECT DISTINCT?uri WHERE {?uri <http://dbpedia.org/ontology/text> ?uri }"
SELECT DISTINCT?uri WHERE { res:Salt_Lake_City dbo:timeZone }
"What is the dbo:timeZone of res:Salt_Lake_City?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Salt_Lake_City> <http://dbpedia.org/ontology/timeZone> }"
SELECT DISTINCT?uri WHERE { res:Caesar_(game) dbo:billed?uri }
"Who dbo:billed res:Caesar_(game)?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Caesar_(game)> <http://dbpedia.org/ontology/billed> ?uri }"
SELECT DISTINCT?uri WHERE { res:Germany dbo:elevation?uri }
"What is the dbo:elevation in res:Germany?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Germany> <http://dbpedia.org/ontology/elevation> ?uri }"
SELECT DISTINCT?uri WHERE { res:Vietnam_War dbo:office?uri }
"Which res:Organization_of_American_States were in dbo:office during the res:Vietnam_War?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Vietnam_War> <http://dbpedia.org/ontology/office> ?uri }"
SELECT DISTINCT?uri WHERE { res:Butch Otter dbo:governor?uri } ORDER BY DESC(?uri) OFFSET 0 LIMIT 1
"Butch Otter is the dbo:governor of which U.S. state?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Butch> Otter <http://dbpedia.org/ontology/governor> ?uri } ORDER BY DESC(?uri) OFFSET 0 LIMIT 1"
SELECT DISTINCT?uri WHERE { res:Michael_Phelps dbo:award?uri }
"How many dbo:goldMedalist did res:Michael_Phelps dbo:award at the res:2008_Summer_Olympics?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Michael_Phelps> <http://dbpedia.org/ontology/award> ?uri }"
SELECT DISTINCT?date WHERE { res:Rachel_Stevens dbo:birthPlace?date }
"Which dbp:artist were dbo:birthPlace on the same date as res:Rachel_Stevens?","SELECT DISTINCT?date WHERE { <http://dbpedia.org/resource/Rachel_Stevens> <http://dbpedia.org/ontology/birthPlace> ?date }"
SELECT DISTINCT?uri WHERE { res:Frank_Herbert dbo:profession?uri }
"What is the dbo:profession of res:Frank_Herbert?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Frank_Herbert> <http://dbpedia.org/ontology/profession> ?uri }"
ASK WHERE { res:Japan dbo:type res:Taiko }
"Are res:Taiko some kind of res:Japan?","ASK WHERE { <http://dbpedia.org/resource/Japan> <http://dbpedia.org/ontology/type> <http://dbpedia.org/resource/Taiko> }"
SELECT DISTINCT?uri WHERE { res:FC_Porto dbo:numberOfSeat?uri }
"How many dbp:seat does the home res:FC_Porto have?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/FC_Porto> <http://dbpedia.org/ontology/numberOfSeat> ?uri }"
SELECT DISTINCT?uri WHERE { res:Frequent-Flyer_program dbo:airlineCode }
"Which res:Frequent-flyer_program has the most dbo:icaoAirlineCode?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Frequent-Flyer_program> <http://dbpedia.org/ontology/airlineCode> }"
SELECT DISTINCT?uri WHERE { res:Europe dbo:government?uri }
"Which res:Europe have a res:Constitutional_monarchy?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Europe> <http://dbpedia.org/ontology/government> ?uri }"
SELECT DISTINCT?uri WHERE { res:Countries_of_the_United_Kingdom dbo:country?uri }
"Which res:Countries_of_the_United_Kingdom have dbo:place with more than two res:Caves_of_Aggtelek_Karst_and_Slovak_Karst?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Countries_of_the_United_Kingdom> <http://dbpedia.org/ontology/country> ?uri }"
SELECT DISTINCT?uri WHERE { res:United_States dbo:targetAirport?uri }
"Which dbo:targetAirport are dbo:place in res:California,_Cincinnati res:United_States?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/United_States> <http://dbpedia.org/ontology/targetAirport> ?uri }"
SELECT DISTINCT?uri WHERE { res:San_Francisco dbo:mascot?uri }
"What are the dbo:mascot of res:San_Francisco?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/San_Francisco> <http://dbpedia.org/ontology/mascot> ?uri }"
SELECT DISTINCT?uri WHERE { res:Name_at_birth dbo:birthPlace?uri }
"What is res:Name_at_birth?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Name_at_birth> <http://dbpedia.org/ontology/birthPlace> ?uri }"
SELECT DISTINCT?uri WHERE { res:Berlin dbo:mayor?uri }
"Who is the dbo:mayor of res:Berlin?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Berlin> <http://dbpedia.org/ontology/mayor> ?uri }"
SELECT DISTINCT?uri WHERE { res:Countries_of_the_United_Kingdom dbo:country?uri }
"Which res:Countries_of_the_United_Kingdom in the res:Europe?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Countries_of_the_United_Kingdom> <http://dbpedia.org/ontology/country> ?uri }"
SELECT DISTINCT?uri WHERE { res:Mean_Hamster_Software dbo:publisher?uri }
"Which res:Software has been dbo:publisher by res:Mean_Hamster_Software?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Mean_Hamster_Software> <http://dbpedia.org/ontology/publisher> ?uri }"
SELECT DISTINCT?uri WHERE { res:Bill_Gates dbo:birthPlace?uri }
"Which dbo:country was res:Bill_Gates dbo:birthPlace in?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Bill_Gates> <http://dbpedia.org/ontology/birthPlace> ?uri }"
SELECT DISTINCT?uri WHERE { res:Jacques_Cousteau dbo:child?uri }
"How many dbo:child did res:Jacques_Cousteau have?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Jacques_Cousteau> <http://dbpedia.org/ontology/child> ?uri }"
SELECT DISTINCT?uri WHERE { res:Sweden dbo:occupation?uri }
"Give me all dbo:occupation from res:Sweden.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Sweden> <http://dbpedia.org/ontology/occupation> ?uri }"
SELECT DISTINCT?uri WHERE { res:United_Kingdom dbo:spouse res:Germany }
"Which dbo:leader of the res:United_Kingdom were dbo:spouse to a res:Germany?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/United_Kingdom> <http://dbpedia.org/ontology/spouse> <http://dbpedia.org/resource/Germany> }"
SELECT DISTINCT?uri WHERE { res:Argentina dbo:country?uri }
"Give me all res:Argentina.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Argentina> <http://dbpedia.org/ontology/country> ?uri }"
SELECT DISTINCT?uri WHERE { res:Michael_Jackson dbo:deathDate }
"How did res:Michael_Jackson dbo:deathDate?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Michael_Jackson> <http://dbpedia.org/ontology/deathDate> }"
SELECT DISTINCT?uri WHERE {?uri dbo:state?uri }
"Which U.S. state has been dbp:known latest?","SELECT DISTINCT?uri WHERE {?uri <http://dbpedia.org/ontology/state> ?uri }"
SELECT DISTINCT?uri WHERE { res:Millipede dbo:date?uri }
"Which dbo:classes does the res:Millipede dbo:date to?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Millipede> <http://dbpedia.org/ontology/date> ?uri }"
SELECT DISTINCT?uri WHERE { res:Forbes dbo:headline?uri }
"Give me the homepage of res:Forbes.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Forbes> <http://dbpedia.org/ontology/headline> ?uri }"
SELECT DISTINCT?uri WHERE { res:Amanda_Palmer dbo:spouse?uri }
"Who is the dbo:spouse of res:Amanda_Palmer?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Amanda_Palmer> <http://dbpedia.org/ontology/spouse> ?uri }"
SELECT DISTINCT?uri WHERE { res:The_Storm_on_the_Sea_of_Galilee dbo:artist?uri }
"Who dbp:artist res:The_Storm_on_the_Sea_of_Galilee?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/The_Storm_on_the_Sea_of_Galilee> <http://dbpedia.org/ontology/artist> ?uri }"
SELECT DISTINCT?uri WHERE { res:Karakoram dbo:elevation?uri }
"What is the dbo:elevation of res:Karakoram?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Karakoram> <http://dbpedia.org/ontology/elevation> ?uri }"
SELECT DISTINCT?date WHERE { res:Basque_language dbo:date?date }
"When did res:Join res:Basque_language?","SELECT DISTINCT?date WHERE { <http://dbpedia.org/resource/Basque_language> <http://dbpedia.org/ontology/date> ?date }"
SELECT DISTINCT?uri WHERE { res:The_Big_Bang_Theory dbo:starring?uri }
"Which dbo:background dbo:starring in res:The_Big_Bang_Theory?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/The_Big_Bang_Theory> <http://dbpedia.org/ontology/starring> ?uri }"
SELECT DISTINCT?uri WHERE { res:Oscar dbo:award?uri }
"Which res:Computer_scientist dbo:award an res:Oscar?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Oscar> <http://dbpedia.org/ontology/award> ?uri }"
SELECT DISTINCT?uri WHERE { res:Harry_Potter dbo:author?uri }
"Who dbp:author res:Harry_Potter?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Harry_Potter> <http://dbpedia.org/ontology/author> ?uri }"
SELECT DISTINCT?uri WHERE { res:Nobel_Prize dbo:Literature dbp:award?uri }
"Give me all dbo:writer that dbo:award the res:Nobel_Prize in res:Literature.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Nobel_Prize> <http://dbpedia.org/ontology/Literature> <http://dbpedia.org/property/award> ?uri }"
SELECT DISTINCT?uri WHERE { res:Lovesick_(Priscilla_Renea_song) dbo:starring?uri }
"Give me res:The_Actors dbo:starring in res:Lovesick_(Priscilla_Renea_song).","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Lovesick_(Priscilla_Renea_song)> <http://dbpedia.org/ontology/starring> ?uri }"
SELECT DISTINCT?uri WHERE { res:Baghdad dbo:address?uri }
"What is the dbo:address of res:Baghdad?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Baghdad> <http://dbpedia.org/ontology/address> ?uri }"
SELECT DISTINCT?uri WHERE { res:Montenegro dbo:birthPlace dbp:leader?uri } ORDER BY DESC(?uri) OFFSET 0 LIMIT 1
"In which dbo:city was the dbo:president of res:Montenegro dbo:birthPlace?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Montenegro> <http://dbpedia.org/ontology/birthPlace> <http://dbpedia.org/property/leader> ?uri } ORDER BY DESC(?uri) OFFSET 0 LIMIT 1"
SELECT DISTINCT?uri WHERE { res:Population_density dbo:state?uri }
"Which U.S. state has the res:Population_density?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Population_density> <http://dbpedia.org/ontology/state> ?uri }"
SELECT Dbo:River WHERE { res:China dbo:river dbp:length?length }
"What is the longest dbo:river in res:China?","SELECT Dbo:River WHERE { <http://dbpedia.org/resource/China> <http://dbpedia.org/ontology/river> <http://dbpedia.org/property/length> ?length }"
SELECT DISTINCT?uri WHERE { res:Berlin dbo:area?uri }
"What is the dbo:areaCode of res:Berlin?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Berlin> <http://dbpedia.org/ontology/area> ?uri }"
SELECT DISTINCT?uri WHERE { res:Ivy_League dbo:effectiveRadiatedPower?uri }
"How many res:Scientists_for_Global_Responsibility dbo:effectiveRadiatedPower from an res:Ivy_League?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Ivy_League> <http://dbpedia.org/ontology/effectiveRadiatedPower> ?uri }"
SELECT DISTINCT?uri WHERE { res:Australia dbo:birthPlace?uri }
"Which dbo:specialist were dbo:birthPlace in res:Australia?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Australia> <http://dbpedia.org/ontology/birthPlace> ?uri }"
SELECT DISTINCT?uri WHERE { res:Curaçao dbo:country?uri }
"Give me all res:Curaçao.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Curaçao> <http://dbpedia.org/ontology/country> ?uri }"
SELECT DISTINCT?uri WHERE { res:Mars dbo:moon?uri }
"How many res:7805_Moons does res:Mars have?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Mars> <http://dbpedia.org/ontology/moon> ?uri }"
SELECT DISTINCT?uri WHERE { res:Batman dbo:name?uri }
"What is res:Batman's res:Real-name_system?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Batman> <http://dbpedia.org/ontology/name> ?uri }"
SELECT DISTINCT?uri WHERE { res:Elon_Musk dbo:author?uri }
"What is res:Elon_Musk for?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Elon_Musk> <http://dbpedia.org/ontology/author> ?uri }"
SELECT DISTINCT?uri WHERE { res:WikiLeaks dbo:author?uri }
"Who is the dbo:author of res:WikiLeaks?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/WikiLeaks> <http://dbpedia.org/ontology/author> ?uri }"
SELECT DISTINCT?uri WHERE { res:Sean_Parnell dbo:governor?uri }
"Sean Parnell was the dbo:governor of which U.S. state?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Sean_Parnell> <http://dbpedia.org/ontology/governor> ?uri }"
SELECT DISTINCT?uri WHERE { res:Ford_Model_48 dbo:manufacturer?uri }
"How many years was the res:Ford_Model_48 res:T dbo:manufacturer?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Ford_Model_48> <http://dbpedia.org/ontology/manufacturer> ?uri }"
SELECT DISTINCT?date WHERE { res:Carlo_Giuliani dbo:dischargeDate?date }
"When was res:Carlo_Giuliani,_Boy dbo:discharge?","SELECT DISTINCT?date WHERE { <http://dbpedia.org/resource/Carlo_Giuliani> <http://dbpedia.org/ontology/dischargeDate> ?date }"
SELECT DISTINCT?uri WHERE {?uri rdf:type dbo:Animal }
"Give me all dbo:animal that are dbo:quote.","SELECT DISTINCT?uri WHERE {?uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Animal> }"
SELECT DISTINCT?uri WHERE { res:USS_President_Lincoln_(1907) dbo:spouse?uri }
"Who was the dbo:spouse of res:USS_President_Lincoln_(1907)?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/USS_President_Lincoln_(1907)> <http://dbpedia.org/ontology/spouse> ?uri }"
SELECT DISTINCT?uri WHERE { res:Bertrand_Russell dbo:award?uri }
"How many dbp:awards has res:Bertrand_Russell?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Bertrand_Russell> <http://dbpedia.org/ontology/award> ?uri }"
ASK WHERE { res:Pamela_Anderson dbo:Vegan?uri }
"Is res:Pamela_Anderson a res:Vegan_Virgin_Valentine?","ASK WHERE { <http://dbpedia.org/resource/Pamela_Anderson> <http://dbpedia.org/ontology/Vegan> ?uri }"
SELECT DISTINCT?uri WHERE {?uri rdf:type dbo:Area } ORDER BY DESC(?uri) OFFSET 0 LIMIT 1
"Which dbo:area were sent into dbo:course around the dbo:year?","SELECT DISTINCT?uri WHERE {?uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Area> } ORDER BY DESC( ?uri) OFFSET 0 LIMIT 1"
SELECT DISTINCT?uri WHERE { res:Germany dbo:populationTotal?uri }
"Which res:Germany have more than res:Population?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Germany> <http://dbpedia.org/ontology/populationTotal> ?uri }"
SELECT DISTINCT?uri WHERE { res:Robert_F._Kennedy dbo:child?uri }
"Who is the dbo:child of res:Robert_F._Kennedy dbp:spouse to?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Robert_F> . _Kennedy <http://dbpedia.org/ontology/child> ?uri }"
SELECT DISTINCT?uri WHERE { res:Vrije_Universiteit_Amsterdam dbo:numberOfStudents?uri }
"How many dbo:numberOfStudents does the res:Vrije_Universiteit_Amsterdam have?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Vrije_Universiteit_Amsterdam> <http://dbpedia.org/ontology/numberOfStudents> ?uri }"
SELECT DISTINCT?uri WHERE { res:IBM dbo:revenue?uri }
"What is the dbo:revenue of res:IBM?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/IBM> <http://dbpedia.org/ontology/revenue> ?uri }"
SELECT DISTINCT?uri WHERE { res:M_(James_Bond) dbo:last?uri }
"How many res:M_(James_Bond) do dbp:last?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/M_(James_Bond)> <http://dbpedia.org/ontology/last> ?uri }"
SELECT DISTINCT?uri WHERE { res:Bart_Simpson dbo:voice?uri }
"Who does the dbo:voice of res:Bart_Simpson?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Bart_Simpson> <http://dbpedia.org/ontology/voice> ?uri }"
SELECT DISTINCT?uri WHERE { res:Tom_Hanks dbp:spouse?uri }
"Who was res:Tom_Hanks dbp:spouse to?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Tom_Hanks> <http://dbpedia.org/property/spouse> ?uri }"
SELECT DISTINCT?uri WHERE { res:Yenisei_River dbo:country?uri }
"Through which res:Countries_of_the_United_Kingdom does the res:Yenisei_River?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Yenisei_River> <http://dbpedia.org/ontology/country> ?uri }"
SELECT DISTINCT?uri WHERE { res:Germany dbo:author?uri }
"Give me all dbo:management that are dbo:author in res:Germany.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Germany> <http://dbpedia.org/ontology/author> ?uri }"
SELECT DISTINCT?date WHERE { res:Michael_Jackson dbo:deathDate }
"When did res:Michael_Jackson dbo:deathDate?","SELECT DISTINCT?date WHERE { <http://dbpedia.org/resource/Michael_Jackson> <http://dbpedia.org/ontology/deathDate> }"
SELECT DISTINCT?uri WHERE { res:Africa dbo:head?uri }
"What is the dbo:head in res:Africa?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Africa> <http://dbpedia.org/ontology/head> ?uri }"
SELECT DISTINCT?uri WHERE {?uri rdf:type dbo:Book ; dbp:author?uri } ORDER BY DESC(?uri) OFFSET 0 LIMIT 1
"Which dbo:author dbo:composer the most dbo:volume?","SELECT DISTINCT?uri WHERE {?uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Book> ; <http://dbpedia.org/property/author> ?uri } ORDER BY DESC(?uri) OFFSET 0 LIMIT 1"
SELECT DISTINCT?uri WHERE {?uri dbo:gangster?uri }
"Give me all gangsters from the dbo:time.","SELECT DISTINCT?uri WHERE {?uri <http://dbpedia.org/ontology/gangster> ?uri }"
SELECT DISTINCT?uri WHERE {?uri dbo:Spacecraft res:Mars }
"Give me all res:Spacecraft that dbo:circulation to res:Mars.","SELECT DISTINCT?uri WHERE {?uri <http://dbpedia.org/ontology/Spacecraft> <http://dbpedia.org/resource/Mars> }"
SELECT DISTINCT?uri WHERE { res:Czech_Republic dbo:country?uri }
"Show me all res:Czech_Republic.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Czech_Republic> <http://dbpedia.org/ontology/country> ?uri }"
SELECT DISTINCT?uri WHERE {?uri rdf:type dbo:Astronaut }
"Give me all taikonauts.","SELECT DISTINCT?uri WHERE {?uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Astronaut> }"
SELECT DISTINCT?uri WHERE { res:Volcano_National_Park dbo:country?uri }
"Which res:Countries_of_the_United_Kingdom have more than ten res:Volcanoes_National_Park?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Volcano_National_Park> <http://dbpedia.org/ontology/country> ?uri }"
SELECT DISTINCT?uri WHERE { res:Tom_Cruise dbo:starring?uri }
"Give me all dbo:film with res:Tom_Cruise.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Tom_Cruise> <http://dbpedia.org/ontology/starring> ?uri }"
SELECT DISTINCT?date WHERE { res:Count_Dracula dbo:deathDate }
"When did res:Count_Dracula's dbp:producer dbo:deathDate?","SELECT DISTINCT?date WHERE { <http://dbpedia.org/resource/Count_Dracula> <http://dbpedia.org/ontology/deathDate> }"
SELECT DISTINCT?uri WHERE { res:English_Wikipedia dbo:author?uri }
"Who dbo:author res:English_Wikipedia?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/English_Wikipedia> <http://dbpedia.org/ontology/author> ?uri }"
SELECT DISTINCT?uri WHERE { res:List_of_German_female_artists dbo:artist?uri }
"Give me all res:List_of_German_female_artists.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/List_of_German_female_artists> <http://dbpedia.org/ontology/artist> ?uri }"
SELECT DISTINCT?uri WHERE { res:Aldi dbo:family?uri }
"Who dbo:family res:Aldi?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Aldi> <http://dbpedia.org/ontology/family> ?uri }"
SELECT DISTINCT?uri WHERE { res:Danielle_Steel dbo:author?uri }
"Which dbo:volume were dbo:writer by res:Danielle_Steel?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Danielle_Steel> <http://dbpedia.org/ontology/author> ?uri }"
SELECT DISTINCT?uri WHERE { res:Socrates dbo:influenced?uri }
"Who was dbo:influenced by res:Socrates?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Socrates> <http://dbpedia.org/ontology/influenced> ?uri }"
SELECT DISTINCT?uri WHERE { res:Chiemsee dbo:capital?uri }
"How dbo:capital is res:Chiemsee?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Chiemsee> <http://dbpedia.org/ontology/capital> ?uri }"
SELECT DISTINCT?uri WHERE { res:New_York_Stock_Exchange dbo:company?uri }
"Which res:Companies_listed_on_the_New_York_Stock_Exchange_(J) dbo:service in the dbp:industry as well as in res:Medicine?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/New_York_Stock_Exchange> <http://dbpedia.org/ontology/company> ?uri }"
SELECT DISTINCT?uri WHERE { res:Philippines dbo:authority?uri }
"Which dbp:authority were dbo:birthPlace on the res:Philippines?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Philippines> <http://dbpedia.org/ontology/authority> ?uri }"
SELECT DISTINCT?uri WHERE { res:Queen_Victoria dbo:parent?uri }
"Who were the dbo:parent of res:Queen_Victoria?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Queen_Victoria> <http://dbpedia.org/ontology/parent> ?uri }"
SELECT DISTINCT?uri WHERE { res:United_States dbo:class?uri }
"Are there any dbo:class in the res:United_States?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/United_States> <http://dbpedia.org/ontology/class> ?uri }"
SELECT Dbo:Language WHERE { res:Estonia dbo:spokenIn }
"Which dbo:language are dbo:spokenIn in res:Estonia?","SELECT Dbo:Language WHERE { <http://dbpedia.org/resource/Estonia> <http://dbpedia.org/ontology/spokenIn> }"
SELECT DISTINCT?uri WHERE {?uri rdf:type dbo:Principal?uri } ORDER BY DESC(?uri) OFFSET 0 LIMIT 1
"Give me a list of all dbo:principal endangered dbo:date.","SELECT DISTINCT?uri WHERE {?uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Principal> ?uri } ORDER BY DESC(?uri) OFFSET 0 LIMIT 1"
SELECT DISTINCT?uri WHERE { res:Rhine dbo:country?uri }
"Which res:Countries_of_the_United_Kingdom are dbo:related by the res:Rhine?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Rhine> <http://dbpedia.org/ontology/country> ?uri }"
SELECT DISTINCT?uri WHERE { res:Elizabeth_II dbo:parent?uri }
"Who was the dbo:parent of res:Elizabeth_II?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Elizabeth_II> <http://dbpedia.org/ontology/parent> ?uri }"
SELECT DISTINCT?uri WHERE { res:Sand_casting dbo:casting?uri }
"Give me all res:Sand_casting.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Sand_casting> <http://dbpedia.org/ontology/casting> ?uri }"
SELECT DISTINCT?uri WHERE { res:Organization_of_American_States dbo:year?uri }
"Give me all res:Organization_of_American_States of the last res:20 years.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Organization_of_American_States> <http://dbpedia.org/ontology/year> ?uri }"
SELECT DISTINCT?uri WHERE { res:Netherlands dbo:location?uri }
"When is the res:Worst-case_scenario going to be in dbo:picture in the res:Netherlands?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Netherlands> <http://dbpedia.org/ontology/location> ?uri }"
SELECT DISTINCT?uri WHERE { res:Lance_Bass dbo:spouse }
"Whom did res:Lance_Bass dbo:spouse?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Lance_Bass> <http://dbpedia.org/ontology/spouse> }"
SELECT DISTINCT?uri WHERE { res:Glasgow_Airport dbo:subsidiary?uri }
"Which dbo:subsidiary of TUI Travel dbo:order both res:Glasgow_Airport and res:Dublin_Airport?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Glasgow_Airport> <http://dbpedia.org/ontology/subsidiary> ?uri }"
SELECT Dbo:Language WHERE { res:Pakistan dbo:spokenIn }
"What dbo:language are dbo:spokenIn in res:Pakistan?","SELECT Dbo:Language WHERE { <http://dbpedia.org/resource/Pakistan> <http://dbpedia.org/ontology/spokenIn> }"
SELECT DISTINCT?uri WHERE { res:Bill_Clinton dbo:spouse res:Dbo:child?uri }
"Who is the dbo:child of res:Bill_Clinton dbo:spouse to?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Bill_Clinton> <http://dbpedia.org/ontology/spouse> <http://dbpedia.org/resource/Dbo:child> ?uri }"
SELECT DISTINCT?uri WHERE { res:Apollo_11 dbo:mission?uri }
"Who was on the res:Apollo_11?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Apollo_11> <http://dbpedia.org/ontology/mission> ?uri }"
SELECT DISTINCT?uri WHERE { res:Indigo dbo:wavelength?uri }
"What is the dbo:wavelength of res:Indigo?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Indigo> <http://dbpedia.org/ontology/wavelength> ?uri }"
SELECT DISTINCT?uri WHERE { res:The_B-Sides dbo:team?uri }
"Give me all res:The_B-Sides.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/The_B-Sides> <http://dbpedia.org/ontology/team> ?uri }"
SELECT DISTINCT?uri WHERE { res:Scarface dbo:alias?uri }
"Who was dbo:alias res:Scarface?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Scarface> <http://dbpedia.org/ontology/alias> ?uri }"
SELECT DISTINCT?uri WHERE { res:North_Sea dbo:operator?uri }
"Which dbo:operator dbp:float into the res:North_Sea?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/North_Sea> <http://dbpedia.org/ontology/operator> ?uri }"
SELECT DISTINCT?uri WHERE { res:Fort_Knox dbp:location dbo:location?uri }
"Where is res:Fort_Knox dbp:location?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Fort_Knox> <http://dbpedia.org/property/location> <http://dbpedia.org/ontology/location> ?uri }"
SELECT DISTINCT?uri WHERE { res:United_Kingdom dbp:deathPlace dbo:birthPlace?uri }
"Which res:Daughters_of_the_Dust of res:United_Kingdom dbp:deathPlace at the same dbo:place they were dbo:birthPlace at?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/United_Kingdom> <http://dbpedia.org/property/deathPlace> <http://dbpedia.org/ontology/birthPlace> ?uri }"
SELECT DISTINCT?uri WHERE { res:China dbo:leader?uri }
"How many dbo:leader did res:China have?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/China> <http://dbpedia.org/ontology/leader> ?uri }"
SELECT DISTINCT?uri WHERE { res:Teenage_Mutant_Ninja_Turtles dbo:athletics?uri }
"What are the dbo:athletics of the res:Teenage_Mutant_Ninja_Turtles?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Teenage_Mutant_Ninja_Turtles> <http://dbpedia.org/ontology/athletics> ?uri }"
SELECT DISTINCT?uri WHERE { res:Piccadilly dbo:routeStart?uri }
"Where does res:Piccadilly dbo:routeStart?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Piccadilly> <http://dbpedia.org/ontology/routeStart> ?uri }"
SELECT DISTINCT?uri WHERE { res:University_of_Alabama dbo:spouse?uri }
"What is the dbp:name of the dbo:university where res:University_of_Alabama's dbp:spouse dbo:office?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/University_of_Alabama> <http://dbpedia.org/ontology/spouse> ?uri }"
SELECT DISTINCT?uri WHERE { res:Paraguay dbo:state res:Independence }
"When did res:Paraguay dbo:state its res:Independence?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Paraguay> <http://dbpedia.org/ontology/state> <http://dbpedia.org/resource/Independence> }"
SELECT DISTINCT?uri WHERE { res:National_Basketball_Association dbo:activePlayer?uri }
"How dbo:thumbnail is the dbo:thumbnailest active res:National_Basketball_Association player?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/National_Basketball_Association> <http://dbpedia.org/ontology/activePlayer> ?uri }"
SELECT DISTINCT?uri WHERE { res:Abraham_Lincoln dbo:deathDate }
"Where did res:Abraham_Lincoln dbo:deathDate?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Abraham_Lincoln> <http://dbpedia.org/ontology/deathDate> }"
SELECT DISTINCT?date WHERE { res:Jack_Wolfskin dbo:foundingYear }
"When was res:Jack_Wolfskin dbo:foundingYear?","SELECT DISTINCT?date WHERE { <http://dbpedia.org/resource/Jack_Wolfskin> <http://dbpedia.org/ontology/foundingYear> }"
SELECT DISTINCT?uri WHERE { res:Air_China dbo:headquarter?uri }
"In which dbo:city is the dbo:headquarter of res:Air_China?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Air_China> <http://dbpedia.org/ontology/headquarter> ?uri }"
SELECT DISTINCT?uri WHERE { res:Pilsner_Urquell dbo:foundedYear?uri }
"What is the dbo:foundingYear year of the dbo:manufacturer that dbo:manufacturer res:Pilsner_Urquell?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Pilsner_Urquell> <http://dbpedia.org/ontology/foundedYear> ?uri }"
SELECT DISTINCT?date WHERE { res:Boston_Tea_Party dbo:place?date }
"When did the res:Boston_Tea_Party take dbo:place?","SELECT DISTINCT?date WHERE { <http://dbpedia.org/resource/Boston_Tea_Party> <http://dbpedia.org/ontology/place> ?date }"
SELECT DISTINCT?uri WHERE {?uri dbo:animal dbp:endangered?uri } ORDER BY DESC(?uri) OFFSET 0 LIMIT 1
"Which dbo:animal are dbo:principal endangered?","SELECT DISTINCT?uri WHERE {?uri <http://dbpedia.org/ontology/animal> <http://dbpedia.org/property/endangered> ?uri } ORDER BY DESC(?uri) OFFSET 0 LIMIT 1"
SELECT DISTINCT?uri WHERE { res:Germany dbo:spouse?uri }
"Which res:Politicians_of_The_Wire were dbo:spouse to a res:Germany?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Germany> <http://dbpedia.org/ontology/spouse> ?uri }"
SELECT DISTINCT?height WHERE {?height dbo:dbo:height }
"How big is the dbo:ground's dbo:diameter?","SELECT DISTINCT?height WHERE {?height <http://dbpedia.org/ontology/dbo:height> }"
ASK WHERE { res:Barack_Obama dbo:spouse res:Michelle_Obama }
"Is the dbp:spouse of President res:Barack_Obama dbo:guest Michelle?","ASK WHERE { <http://dbpedia.org/resource/Barack_Obama> <http://dbpedia.org/ontology/spouse> <http://dbpedia.org/resource/Michelle_Obama> }"
SELECT DISTINCT?uri WHERE { res:MN dbo:state?uri }
"Which U.S. state has the dbo:abbreviation res:MN?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/MN> <http://dbpedia.org/ontology/state> ?uri }"
SELECT DISTINCT?date WHERE { res:Muhammad dbo:deathDate dbp:date?date }
"When did res:Muhammad dbo:deathDate?","SELECT DISTINCT?date WHERE { <http://dbpedia.org/resource/Muhammad> <http://dbpedia.org/ontology/deathDate> <http://dbpedia.org/property/date> ?date }"
SELECT DISTINCT?uri WHERE { res:Moon dbo:musicComposer dbp:background?uri } ORDER BY DESC(?uri) OFFSET 0 LIMIT 1
"What is the dbp:background of the res:Moon dbo:musicComposer of?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Moon> <http://dbpedia.org/ontology/musicComposer> <http://dbpedia.org/property/background> ?uri } ORDER BY DESC(?uri) OFFSET 0 LIMIT 1"
SELECT DISTINCT?uri WHERE { res:Texas dbo:governor?uri }
"Who is the dbo:governor of res:Texas?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Texas> <http://dbpedia.org/ontology/governor> ?uri }"
SELECT DISTINCT?uri WHERE { res:Akira_Kurosawa dbo:director }
"Which dbo:film did res:Akira_Kurosawa dbo:director?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Akira_Kurosawa> <http://dbpedia.org/ontology/director> }"
SELECT DISTINCT?uri WHERE { res:San_Antonio dbo:name?uri }
"What was the dbp:name of the dbo:motto in res:1836 in res:San_Antonio?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/San_Antonio> <http://dbpedia.org/ontology/name> ?uri }"
SELECT DISTINCT?uri WHERE { res:Charmed dbo:officialLanguage?uri }
"Give me the dbo:officialLanguage of dbo:background of the res:Charmed.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Charmed> <http://dbpedia.org/ontology/officialLanguage> ?uri }"
SELECT DISTINCT?uri WHERE { res:Baguette dbo:numberOfCalories?uri }
"How many dbp:calories does a res:Baguette have?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Baguette> <http://dbpedia.org/ontology/numberOfCalories> ?uri }"
SELECT DISTINCT?uri WHERE { res:Brighton_and_Hove dbo:established?uri }
"Give me all res:Libraries_in_Brighton_and_Hove dbo:established before res:1400.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Brighton_and_Hove> <http://dbpedia.org/ontology/established> ?uri }"
SELECT DISTINCT?uri WHERE {?uri dbo:country res:Netherlands_Antilles_at_the_2007_Pan_American_Games }
"Give me all res:Frisian_Islands that dbp:rank to the res:Netherlands_Antilles_at_the_2007_Pan_American_Games.","SELECT DISTINCT?uri WHERE {?uri <http://dbpedia.org/ontology/country> <http://dbpedia.org/resource/Netherlands_Antilles_at_the_2007_Pan_American_Games> }"
SELECT DISTINCT?uri WHERE { res:The_Scream dbo:museum }
"Which dbo:museum dbo:sport res:The_Scream?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/The_Scream> <http://dbpedia.org/ontology/museum> }"
SELECT DISTINCT?date WHERE { res:De_Beers dbo:foundedBy }
"When was the res:De_Beers dbo:foundedBy?","SELECT DISTINCT?date WHERE { <http://dbpedia.org/resource/De_Beers> <http://dbpedia.org/ontology/foundedBy> }"
SELECT DISTINCT?uri WHERE { res:John_F._Kennedy dbo:deathDate }
"Who became dbo:president after res:John_F._Kennedy dbo:deathDate?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/John_F> . _Kennedy <http://dbpedia.org/ontology/deathDate> }"
SELECT DISTINCT?uri WHERE { res:Juan_Carlos_I_of_Spain dbo:spouse?uri }
"Who are the dbo:parent of the dbo:spouse of res:Juan_Carlos_I_of_Spain res:I?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Juan_Carlos_I_of_Spain> <http://dbpedia.org/ontology/spouse> ?uri }"
"Who is the dbo:author of the dbo:service a dbo:anthem of dbo:frozen and fire?",""
SELECT DISTINCT?uri WHERE { res:Beatles_VI dbo:recordLabel?uri }
"In which dbp:studio did the res:Beatles_VI dbo:recordLabel their first dbo:album?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Beatles_VI> <http://dbpedia.org/ontology/recordLabel> ?uri }"
SELECT DISTINCT?uri WHERE { res:Museum_of_Beer_and_Brewing dbo:location?uri }
"Which res:Museum_of_Beer_and_Brewing are dbp:stand in res:North_Rhine-Westphalia?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Museum_of_Beer_and_Brewing> <http://dbpedia.org/ontology/location> ?uri }"
SELECT DISTINCT?date WHERE { res:Diana,_Princess_of_Wales dbo:deathDate }
"When did res:Diana,_Princess_of_Wales dbo:deathDate?","SELECT DISTINCT?date WHERE { <http://dbpedia.org/resource/Diana,_Princess_of_Wales> <http://dbpedia.org/ontology/deathDate> }"
SELECT DISTINCT?uri WHERE { res:Intel dbo:foundingYear?uri }
"Who dbo:foundingYear res:Intel?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Intel> <http://dbpedia.org/ontology/foundingYear> ?uri }"
SELECT DISTINCT?uri WHERE { res:Premier_League dbo:participant?uri }
"Who is the youngest dbo:participant in the res:Premier_League?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Premier_League> <http://dbpedia.org/ontology/participant> ?uri }"
SELECT DISTINCT?uri WHERE { res:Cat_Stevens dbo:starring?uri }
"Which dbp:instrument does res:Cat_Stevens dbo:starring?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Cat_Stevens> <http://dbpedia.org/ontology/starring> ?uri }"
SELECT DISTINCT?uri WHERE { res:South_Carolina dbo:river }
"How many dbo:river and dbo:lake are in res:South_Carolina?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/South_Carolina> <http://dbpedia.org/ontology/river> }"
SELECT DISTINCT?uri WHERE { res:Rodzilla dbo:alias?uri }
"Who was dbo:alias res:Rodzilla?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Rodzilla> <http://dbpedia.org/ontology/alias> ?uri }"
SELECT DISTINCT?uri WHERE { res:Africa dbo:country?uri }
"Give me the dbo:principal of all res:Countries_of_the_United_Kingdom in res:Africa.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Africa> <http://dbpedia.org/ontology/country> ?uri }"
SELECT DISTINCT?uri WHERE { res:Manhattan_Bridge dbo:type?uri }
"Which dbo:abstract are of the same dbo:type as the res:Manhattan_Bridge?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Manhattan_Bridge> <http://dbpedia.org/ontology/type> ?uri }"
SELECT DISTINCT?uri WHERE { res:Facebook dbo:founder?uri }
"How many res:Companies_listed_on_the_New_York_Stock_Exchange_(J) were dbo:foundingYear by the dbo:founder of res:Facebook?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Facebook> <http://dbpedia.org/ontology/founder> ?uri }"
SELECT DISTINCT?uri WHERE { res:Grand_Canyon dbo:band res:Dbo:leader?uri }
"Show me res:Hiking in the res:Grand_Canyon where there's no dbo:leader of dbo:band.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Grand_Canyon> <http://dbpedia.org/ontology/band> <http://dbpedia.org/resource/Dbo:leader> ?uri }"
SELECT DISTINCT?uri WHERE {?uri rdf:type dbo:Book ; dbp:numberOfPages?uri }
"Which dbo:volume has the most pages?","SELECT DISTINCT?uri WHERE {?uri <http://www.w3.org/1999/02/22-rdf-syntax-ns#type> <http://dbpedia.org/ontology/Book> ; <http://dbpedia.org/property/numberOfPages> ?uri }"
SELECT DISTINCT?uri WHERE { res:United_States dbo:area?uri }
"What is the dbo:areaTotal state in the res:United_States?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/United_States> <http://dbpedia.org/ontology/area> ?uri }"
SELECT DISTINCT?uri WHERE { res:Websites_blocked_in_Pakistan dbo:numberOfEmployees?uri }
"Give me the res:Websites_blocked_in_Pakistan of res:Companies_listed_on_the_New_York_Stock_Exchange_(J) with more than dbo:numberOfEmployees.","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Websites_blocked_in_Pakistan> <http://dbpedia.org/ontology/numberOfEmployees> ?uri }"
SELECT DISTINCT?uri WHERE { res:Columbus dbo:title?uri }
"What were the dbo:title of the three dbo:shipBeam by res:Columbus?","SELECT DISTINCT?uri WHERE { <http://dbpedia.org/resource/Columbus> <http://dbpedia.org/ontology/title> ?uri }"
---------------------------------------------------------------------------
RuntimeError Traceback (most recent call last)
c:\Users\Albin\workspace\codebase\bart\sparql.ipynb Cell 12 in <cell line: 26>()
<a href='vscode-notebook-cell:/c%3A/Users/Albin/workspace/codebase/bart/sparql.ipynb#X33sZmlsZQ%3D%3D?line=34'>35</a> test_data = [q[0] for q in test_data]
<a href='vscode-notebook-cell:/c%3A/Users/Albin/workspace/codebase/bart/sparql.ipynb#X33sZmlsZQ%3D%3D?line=36'>37</a> for i, question in enumerate(test_data):
---> <a href='vscode-notebook-cell:/c%3A/Users/Albin/workspace/codebase/bart/sparql.ipynb#X33sZmlsZQ%3D%3D?line=37'>38</a> predicted = to_query(question)
<a href='vscode-notebook-cell:/c%3A/Users/Albin/workspace/codebase/bart/sparql.ipynb#X33sZmlsZQ%3D%3D?line=38'>39</a> predicted = predicted[0]
<a href='vscode-notebook-cell:/c%3A/Users/Albin/workspace/codebase/bart/sparql.ipynb#X33sZmlsZQ%3D%3D?line=39'>40</a> # Filter everything before the first " and after the last "
c:\Users\Albin\workspace\codebase\bart\sparql.ipynb Cell 12 in to_query(sentence)
<a href='vscode-notebook-cell:/c%3A/Users/Albin/workspace/codebase/bart/sparql.ipynb#X33sZmlsZQ%3D%3D?line=1'>2</a> input = encode(sentence)
<a href='vscode-notebook-cell:/c%3A/Users/Albin/workspace/codebase/bart/sparql.ipynb#X33sZmlsZQ%3D%3D?line=2'>3</a> input.to('cuda')
----> <a href='vscode-notebook-cell:/c%3A/Users/Albin/workspace/codebase/bart/sparql.ipynb#X33sZmlsZQ%3D%3D?line=3'>4</a> predictions = model.generate(input['input_ids'], max_length=256, num_beams=20)
<a href='vscode-notebook-cell:/c%3A/Users/Albin/workspace/codebase/bart/sparql.ipynb#X33sZmlsZQ%3D%3D?line=4'>5</a> return tokenizer.batch_decode(predictions)
File c:\Users\Albin\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\autograd\grad_mode.py:27, in _DecoratorContextManager.__call__.<locals>.decorate_context(*args, **kwargs)
24 @functools.wraps(func)
25 def decorate_context(*args, **kwargs):
26 with self.clone():
---> 27 return func(*args, **kwargs)
File c:\Users\Albin\AppData\Local\Programs\Python\Python39\lib\site-packages\transformers\generation_utils.py:1276, in GenerationMixin.generate(self, inputs, max_length, min_length, do_sample, early_stopping, num_beams, temperature, top_k, top_p, typical_p, repetition_penalty, bad_words_ids, force_words_ids, bos_token_id, pad_token_id, eos_token_id, length_penalty, no_repeat_ngram_size, encoder_no_repeat_ngram_size, num_return_sequences, max_time, max_new_tokens, decoder_start_token_id, use_cache, num_beam_groups, diversity_penalty, prefix_allowed_tokens_fn, logits_processor, renormalize_logits, stopping_criteria, constraints, output_attentions, output_hidden_states, output_scores, return_dict_in_generate, forced_bos_token_id, forced_eos_token_id, remove_invalid_values, synced_gpus, exponential_decay_length_penalty, suppress_tokens, begin_suppress_tokens, forced_decoder_ids, **model_kwargs)
1268 logger.warning(
1269 "A decoder-only architecture is being used, but right-padding was detected! For correct "
1270 "generation results, please set `padding_side='left'` when initializing the tokenizer."
1271 )
1273 if self.config.is_encoder_decoder and "encoder_outputs" not in model_kwargs:
1274 # if model is encoder decoder encoder_outputs are created
1275 # and added to `model_kwargs`
-> 1276 model_kwargs = self._prepare_encoder_decoder_kwargs_for_generation(
1277 inputs_tensor, model_kwargs, model_input_name
1278 )
1280 # 4. Prepare `input_ids` which will be used for auto-regressive generation
1281 if self.config.is_encoder_decoder:
File c:\Users\Albin\AppData\Local\Programs\Python\Python39\lib\site-packages\transformers\generation_utils.py:528, in GenerationMixin._prepare_encoder_decoder_kwargs_for_generation(self, inputs_tensor, model_kwargs, model_input_name)
526 encoder_kwargs["return_dict"] = True
527 encoder_kwargs[model_input_name] = inputs_tensor
--> 528 model_kwargs["encoder_outputs"]: ModelOutput = encoder(**encoder_kwargs)
530 return model_kwargs
File c:\Users\Albin\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py:1130, in Module._call_impl(self, *input, **kwargs)
1126 # If we don't have any hooks, we want to skip the rest of the logic in
1127 # this function, and just call forward.
1128 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
1129 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1130 return forward_call(*input, **kwargs)
1131 # Do not call functions when jit is used
1132 full_backward_hooks, non_full_backward_hooks = [], []
File c:\Users\Albin\AppData\Local\Programs\Python\Python39\lib\site-packages\transformers\models\bart\modeling_bart.py:801, in BartEncoder.forward(self, input_ids, attention_mask, head_mask, inputs_embeds, output_attentions, output_hidden_states, return_dict)
798 raise ValueError("You have to specify either input_ids or inputs_embeds")
800 if inputs_embeds is None:
--> 801 inputs_embeds = self.embed_tokens(input_ids) * self.embed_scale
803 embed_pos = self.embed_positions(input)
805 hidden_states = inputs_embeds + embed_pos
File c:\Users\Albin\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\module.py:1130, in Module._call_impl(self, *input, **kwargs)
1126 # If we don't have any hooks, we want to skip the rest of the logic in
1127 # this function, and just call forward.
1128 if not (self._backward_hooks or self._forward_hooks or self._forward_pre_hooks or _global_backward_hooks
1129 or _global_forward_hooks or _global_forward_pre_hooks):
-> 1130 return forward_call(*input, **kwargs)
1131 # Do not call functions when jit is used
1132 full_backward_hooks, non_full_backward_hooks = [], []
File c:\Users\Albin\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\modules\sparse.py:158, in Embedding.forward(self, input)
157 def forward(self, input: Tensor) -> Tensor:
--> 158 return F.embedding(
159 input, self.weight, self.padding_idx, self.max_norm,
160 self.norm_type, self.scale_grad_by_freq, self.sparse)
File c:\Users\Albin\AppData\Local\Programs\Python\Python39\lib\site-packages\torch\nn\functional.py:2199, in embedding(input, weight, padding_idx, max_norm, norm_type, scale_grad_by_freq, sparse)
2193 # Note [embedding_renorm set_grad_enabled]
2194 # XXX: equivalent to
2195 # with torch.no_grad():
2196 # torch.embedding_renorm_
2197 # remove once script supports set_grad_enabled
2198 _no_grad_embedding_renorm_(weight, input, max_norm, norm_type)
-> 2199 return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
RuntimeError: Expected all tensors to be on the same device, but found at least two devices, cpu and cuda:0! (when checking argument for argument index in method wrapper__index_select)
%% Cell type:code id: tags:
``` python
```
......
# Parameters: input_file output_file er_link_style(optional)
# Example usage: python tokenizer.py qald-9-test-linked.json qald-9-test-tokenized
# Example usage: python tokenizer.py qald-9-test-linked.json qald-9-test-tokenized REPLACE
# Note: output_file is the name of the output file without the extension
# Parameters: input_file er_link_style(optional)
# Example usage: py tokenizer.py qald-9-test-linked.json
# Example usage: py tokenizer.py qald-9-test-linked.json REPLACE
# Note: er_link_style is the style of entity linking to use.
# It can be "REPLACE", "APPEND" or blank. Default is no usage of entity links.
import sys
......@@ -15,18 +14,15 @@ def main():
print("Please provide input file")
sys.exit(1)
if len(sys.argv) > 2:
output_file = sys.argv[2]
else:
print("Please provide output file")
sys.exit(1)
if len(sys.argv) > 3:
er_link_style = sys.argv[3]
er_link_style = sys.argv[2]
if (er_link_style != "REPLACE" and er_link_style != "APPEND"):
print("Please provide a valid entity/relationship linking style")
sys.exit(1)
else:
er_link_style = ""
output_file = input_file.replace(".json", "-tokenized.csv")
prefixes = {
"http://dbpedia.org/resource/": "res:",
"http://dbpedia.org/ontology/": "dbo:",
......@@ -47,7 +43,7 @@ def main():
# Generate a csv file with the tokenized questions from a linked json file
with open(input_file, "r", encoding = "utf-8") as f:
data = json.load(f)
with open(f"{output_file}.csv", "w", encoding = "utf-8") as out:
with open(output_file, "w", encoding = "utf-8") as out:
out.write("text,summary\n")
for item in data["questions"]:
# Keeps track of how many objects we have replaced
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment