Open lecidhugo opened 5 years ago
What is the name of your file? Maybe -mode format_to _bert
wouldn't work if you don't give your json file the right name. You have to name your file in the form "*._corpustype.*.json". For example, the author named the example file "cnndm_sample.train.0.json". Your file name should also follow this format, in order to use the author's pre-processing code.
Hi @nlpyang, I formatted a json file similar to the example you provided in the folder json_data. However, when I tried to apply step5 of the readme I got empty brackets in the terminal and I did not get any .pt output. When applying the same step to your json file, I get the output as expected. below is my json_file: [{"src": [["was", "born", "and", "raised", "in", "Louisville", ",", "Kentucky", ",", "and", "began", "training", "as", "an", "amateur", "boxer", "at", "age", "12", "."], ["18", ",", "he", "won", "a", "gold", "medal", "in", "the", "light", "heavyweight", "division", "at", "the", "1960", "Summer", "Olympics", ",", "and", "turned", "professional", "later", "that", "year", "."], ["converted", "to", "Islam", "and", "became", "a", "Muslim", "after", "1961", ",", "and", "eventually", "took", "the", "name", "Muhammad", "Ali", "."], ["won", "the", "world", "heavyweight", "championship", "from", "Sonny", "Liston", "in", "a", "major", "upset", "at", "age", "22", "in", "1964", "."], ["1966", ",", "Ali", "refused", "to", "be", "drafted", "into", "the", "military", ",", "citing", "his", "religious", "beliefs", "and", "opposition", "to", "the", "Vietnam", "War", "."], ["6", "-RSB-", "-LSB-", "7", "-RSB-", "He", "was", "arrested", ",", "found", "guilty", "of", "draft", "evasion", ",", "and", "stripped", "of", "his", "boxing", "titles", "."], ["appealed", "the", "decision", "to", "the", "Supreme", "Court", ",", "which", "overturned", "his", "conviction", "in", "1971", ",", "but", "he", "had", "not", "fought", "for", "nearly", "four", "years", "and", "lost", "a", "period", "of", "peak", "performance", "as", "an", "athlete", "."], ["actions", "as", "a", "conscientious", "objector", "to", "the", "war", "made", "him", "an", "icon", "for", "the", "larger", "counterculture", "generation", ",", "-LSB-", "8", "-RSB-", "-LSB-", "9", "-RSB-", "and", "he", "was", "a", "high-profile", "figure", "of", "racial", "pride", "for", "African", "Americans", "during", "the", "civil", "rights", "movement", "."], ["6", "-RSB-", "-LSB-", "10", "-RSB-", "As", "a", "Muslim", ",", "Ali", "was", "initially", "affiliated", "with", "Elijah", "Muhammad", "'s", "Nation", "of", "Islam", "-LRB-", "NOI", "-RRB-", "."], ["later", "disavowed", "the", "NOI", ",", "adhering", "to", "Sunni", "Islam", ",", "and", "supporting", "racial", "integration", "like", "his", "former", "mentor", "Malcolm", "X."]], "tgt": [["was", "born", "and", "raised", "in", "Louisville", ",", "Kentucky", ",", "and", "began", "training", "as", "an", "amateur", "boxer", "at", "age", "12", "."]]}]