Datasets:
Tasks:
Text Classification
Modalities:
Text
Formats:
parquet
Languages:
Portuguese
Size:
1K - 10K
License:
Andre Barbosa commited on
Commit ·
e968ade
1
Parent(s): 7236a53
address script documentation and add reference by grader
Browse files10 unmodified lines1112131415161718198 unmodified lines2829303132333435363738394041424337 unmodified lines8182838485866 unmodified lines9394959697989910010110210310410510610710810911011111211311411511611711811912012112212312434 unmodified lines159160161162163164141 unmodified lines30630730830931031131296 unmodified lines40941041141241341441533 unmodified lines449450451452453454264 unmodified lines71972072172272372436 unmodified lines76176276376476576610 unmodified lines# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.# TODO: Address all TODOs and remove all explanatory comments"""TODO: Add a description here."""import csvimport math8 unmodified linesnp.random.seed(42) # Set the seed# TODO: Add BibTeX citation# Find for instance the citation on arxiv or on the dataset repo/website_CITATION = """\TODO"""# TODO: Add description of the dataset here# You can copy an official description_DESCRIPTION = """\This new dataset is designed to solve this great NLP task and is crafted with a lot of care."""# TODO: Add a link to an official homepage for the dataset here37 unmodified lines"general","specific","essay_year",]CSV_HEADERPROPOR = [6 unmodified lines]SOURCE_A_DESC = """Source A have 860 essays available from August 2015 to March 2020.For each month of that period, a new prompt together with supporting texts were given, and the graded essays from the previous month were made available.Of the 56 prompts, 12 had no associated essays available (at the time of download).Additionally, there were 3 prompts that asked for a text in the format of a letter. We removed those 15 prompts and associated texts from the corpus.For an unknown reason, 414 of the essays were graded using a five-point scale of either {0, 50, 100, 150, 200} or its scaled-down version going from 0 to 2.To avoid introducing bias, we also discarded such instances, resulting in a dataset of 386 annotated essays with prompts and supporting texts (with each component being clearly identified).Some of the essays used a six-point scale with 20 points instead of 40 points as the second class. As we believe this introduces minimal bias, we kept such essays and relabeled class 20 as class 40.The original data contains comments from the annotators explaining their per-competence scores. They are included in our dataset."""SOURCE_A_WITH_GRADERS = "Same as SourceA but augmented with reviwers contractors grade's. Each essay then have three grades: the downloaded one and each grader's feedback. "SOURCE_B_DESC = """Source B is very similar to Source A: a new prompt and supporting texts are made available every month along with the graded essays submitted in the previous month.We downloaded HTML sources from 7,700 essays from May 2009 to May 2023. Essays released prior to June 2016 were graded on a five-point scale and consequently discarded.This resulted in a corpus of approx. 3,200 graded essays on 83 different prompts.Although in principle, Source B also provides supporting texts for students, none were available at the time the data was downloaded.To mitigate this, we extracted supporting texts from the Essay-Br corpus, whenever possible, by manually matching prompts between the two corpora.We ended up with approx. 1,000 essays containing both prompt and supporting texts, and approx. 2,200 essays containing only the respective prompt."""PROPOR2024 = """Splits used for PROPOR paper. It is a variation of sourceAWithGraders dataset. Post publication we noticed that there was an issue in the reproducible setting.We fix that and set this config to keep reproducibility w.r.t. numbers reported in the paper."""34 unmodified lines"essay_year": datasets.Value("int16"),"general_comment": datasets.Value("string"),"specific_comment": datasets.Value("string"),})141 unmodified linesfor grader in [grader_a, grader_b]:grader.grades = grader.grades.apply(lambda x: x.strip("[]").split(", "))grader.grades = grader.grades.apply(map_list)return grader_a, grader_bdef _generate_splits(self, filepath: str, train_size=0.7):96 unmodified linesassert (len(set(val_df["id_prompt"]).intersection(set(test_df["id_prompt"]))) == 0), "Overlap between val and test id_prompt"#train_df['essay_year'] = train_df['essay_year'].astype(int)train_df.to_csv(f"{dirname}/train.csv", index=False)val_df.to_csv(f"{dirname}/validation.csv", index=False)test_df.to_csv(f"{dirname}/test.csv", index=False)33 unmodified lines"essay_year": row["essay_year"],"general_comment": row["general"],"specific_comment": row["specific"],}264 unmodified linesgeneral_comment = Nonespecific_comment = Noneessay_year = Nonefor prompt_folder in tqdm(sub_folders,desc=f"Parsing HTML files from: {key}",36 unmodified linesgeneral_comment,specific_comment,essay_year,])essay_id += 110 unmodified lines1112131415168 unmodified lines25262728293031323334353637383940414243444546474849505152535455565758596061626364656667686937 unmodified lines1071081091101111121136 unmodified lines12012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716834 unmodified lines203204205206207208209141 unmodified lines35135235335435535635735896 unmodified lines45545645745845946033 unmodified lines494495496497498499500264 unmodified lines76576676776876977077136 unmodified lines80880981081181281381410 unmodified lines# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.# See the License for the specific language governing permissions and# limitations under the License.import csvimport math8 unmodified linesnp.random.seed(42) # Set the seed_CITATION = """@inproceedings{silveira-etal-2024-new,title = "A New Benchmark for Automatic Essay Scoring in {P}ortuguese",author = "Silveira, Igor Cataneo andBarbosa, Andr{\'e} andMau{\'a}, Denis Deratani",editor = "Gamallo, Pablo andClaro, Daniela andTeixeira, Ant{\'o}nio andReal, Livy andGarcia, Marcos andOliveira, Hugo Goncalo andAmaro, Raquel",booktitle = "Proceedings of the 16th International Conference on Computational Processing of Portuguese - Vol. 1",month = mar,year = "2024",address = "Santiago de Compostela, Galicia/Spain",publisher = "Association for Computational Lingustics",url = "https://aclanthology.org/2024.propor-1.23/",pages = "228--237"}"""_DESCRIPTION = """\This dataset was created as part of our work on advancing Automatic Essay Scoring forBrazilian Portuguese. It comprises a large collection of publicly available essayscollected from websites simulating University Entrance Exams, with a subset expertlyannotated to provide reliable assessment indicators. The dataset includes both the rawtext and processed forms of the essays, along with supporting prompts and supplementaltexts.Key Features:- A diverse corpus of essays with detailed annotations.- A subset graded by expert annotators to evaluate essay quality and task difficulty.- Comprehensive metadata providing provenance and context for each essay.- An empirical analysis framework to support state-of-the-art predictive modeling.For further details, please refer to the paper “A New Benchmark for Automatic EssayScoring in Portuguese” available at https://aclanthology.org/2024.propor-1.23/."""# TODO: Add a link to an official homepage for the dataset here37 unmodified lines"general","specific","essay_year","reference"]CSV_HEADERPROPOR = [6 unmodified lines]SOURCE_A_DESC = """SourceA have 860 essays available from August 2015 to March 2020.For each month of that period, a new prompt together with supporting texts were given,and the graded essays from the previous month were made available.Of the 56 prompts, 12 had no associated essays available (at the time of download).Additionally, there were 3 prompts that asked for a text in the format of a letter.We removed those 15 prompts and associated texts from the corpus.For an unknown reason, 414 of the essays were graded using a five-point scale of either{0, 50, 100, 150, 200} or its scaled-down version going from 0 to 2.To avoid introducing bias, we also discarded such instances, resulting in a dataset of386 annotated essays with prompts and supporting texts (with each component being clearly identified).Some of the essays used a six-point scale with 20 points instead of 40 points as the second class.As we believe this introduces minimal bias, we kept such essays and relabeled class 20 as class 40.The original data contains comments from the annotators explaining their per-competence scores.They are included in our dataset."""SOURCE_A_WITH_GRADERS = """sourceAWithGraders includes the original dataset augmented with grades from additional reviewers.Each essay is replicated three times:1. The original essay with its grades from the website.2. The same essay with grades from the first human grader.3. The same essay with grades from the second human grader."""SOURCE_B_DESC = """SourceB is very similar to Source A: a new prompt and supporting texts are madeavailable every month along with the graded essays submitted in the previous month.We downloaded HTML sources from 7,700 essays from May 2009 to May 2023. Essays releasedprior to June 2016 were graded on a five-point scale and consequently discarded.This resulted in a corpus of approx. 3,200 graded essays on 83 different prompts.Although in principle, Source B also provides supporting texts for students, none wereavailable at the time the data was downloaded.To mitigate this, we extracted supporting texts from the Essay-Br corpus, wheneverpossible, by manually matching prompts between the two corpora.We ended up with approx. 1,000 essays containing both prompt and supporting texts, andapprox. 2,200 essays containing only the respective prompt."""PROPOR2024 = """This split corresponds to the results reported in the PROPOR 2024 paper. While reproducibility wasfixed in the sourceAWithGraders configuration, this split preserves the originaldistribution of prompts and scores as used in the paper."""34 unmodified lines"essay_year": datasets.Value("int16"),"general_comment": datasets.Value("string"),"specific_comment": datasets.Value("string"),"reference": datasets.Value("string"),})141 unmodified linesfor grader in [grader_a, grader_b]:grader.grades = grader.grades.apply(lambda x: x.strip("[]").split(", "))grader.grades = grader.grades.apply(map_list)grader_a["reference"] = "grader_a"grader_b["reference"] = "grader_b"return grader_a, grader_bdef _generate_splits(self, filepath: str, train_size=0.7):96 unmodified linesassert (len(set(val_df["id_prompt"]).intersection(set(test_df["id_prompt"]))) == 0), "Overlap between val and test id_prompt"train_df.to_csv(f"{dirname}/train.csv", index=False)val_df.to_csv(f"{dirname}/validation.csv", index=False)test_df.to_csv(f"{dirname}/test.csv", index=False)33 unmodified lines"essay_year": row["essay_year"],"general_comment": row["general"],"specific_comment": row["specific"],"reference": row["reference"]}264 unmodified linesgeneral_comment = Nonespecific_comment = Noneessay_year = Nonereference = "crawled_from_web"for prompt_folder in tqdm(sub_folders,desc=f"Parsing HTML files from: {key}",36 unmodified linesgeneral_comment,specific_comment,essay_year,reference])essay_id += 1
aes_enem_dataset.py+76-28