Refactor duplicate code #7
Open
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
I am working with Grammatech to use the DIRE model, and found a fair amount of duplicate code. I am working to refactor this project so that duplicate code is removed and instead the shared modules are used as libraries. In standardizing the duplicate code, I found a few discrepancies in the code and was hoping you could help me resolve them before I refactor further.
I also used
isortandblackto standardize code formatting.I simplified all differences that were not operational, however there are some operational differences in the
modelandutilsdirectories underprediction-pluginandneural-model.model/attentional_recurrent_subtoken_decocder.py:AttentionalRecurrentSubtokenDecoder.predict()differs byand the use of a
beam_cntvariablemodel/graph_encoder.py:GraphASTEncoder.unpack_encoding()differs by the specified layer being ofbool()orbyte()typeutils/evalution.py:Evaluator.average()differs by value set toavg_results["corpus_cer"]utils/preprocess.py:is_valid_example()differs by a more complicatedis_validcheckIf you have any input on these discrepancies, then I would be very appreciative, and can move forward with further refactoring :). I am very excited to be working with this code