Compare commits
1 Commits
78acc54e5f
...
8d7d2203b5
Author | SHA1 | Date |
---|---|---|
coolneng | 8d7d2203b5 |
|
@ -22,8 +22,7 @@ def execute_task(args):
|
||||||
if args.task == "train":
|
if args.task == "train":
|
||||||
train_model(data_file=args.data_file, label_file=args.label_file)
|
train_model(data_file=args.data_file, label_file=args.label_file)
|
||||||
else:
|
else:
|
||||||
prediction = await infer_sequence(sequence=args.sequence)
|
infer_sequence(sequence=args.sequence)
|
||||||
print(f"Error-corrected sequence: {prediction}")
|
|
||||||
|
|
||||||
|
|
||||||
def main() -> None:
|
def main() -> None:
|
||||||
|
|
|
@ -71,7 +71,7 @@ def train_model(data_file, label_file, seed_value=42) -> None:
|
||||||
model.save("trained_model")
|
model.save("trained_model")
|
||||||
|
|
||||||
|
|
||||||
async def infer_sequence(sequence) -> str:
|
async def infer_sequence(sequence) -> None:
|
||||||
"""
|
"""
|
||||||
Predict the correct sequence, using the trained model
|
Predict the correct sequence, using the trained model
|
||||||
"""
|
"""
|
||||||
|
@ -81,4 +81,5 @@ async def infer_sequence(sequence) -> str:
|
||||||
prediction = model.predict(one_hot_encoded_sequence)
|
prediction = model.predict(one_hot_encoded_sequence)
|
||||||
encoded_prediction = argmax(prediction, axis=1)
|
encoded_prediction = argmax(prediction, axis=1)
|
||||||
final_prediction = decode_sequence(encoded_prediction)
|
final_prediction = decode_sequence(encoded_prediction)
|
||||||
|
print(f"Error-corrected sequence: {final_prediction}")
|
||||||
return final_prediction
|
return final_prediction
|
||||||
|
|
Loading…
Reference in New Issue