Skip to content

Conversation

jxnl
Copy link
Collaborator

@jxnl jxnl commented Feb 13, 2024

Ellipsis 🚀 This PR description was created by Ellipsis for commit f4b5f76.

Summary:

The PR refactors several functions in the finetune-quora-embeddings application to improve code efficiency and readability, and introduces new functions for handling sentence embeddings and model scoring.

Key points:

  • Refactored the yield_dataset_with_embeddings function in embed.py to yield a dictionary with the sentence embeddings and other related information.
  • Introduced a new function process_embeddings in embed.py to handle the creation of sentence embeddings.
  • Modified the split_embed_train_test function in embed.py to use the new process_embeddings function.
  • Refactored the generate_embeddings function in embed.py to use a generator for saving the embeddings.
  • Introduced a new function scorer in eval.py to handle the scoring of models.
  • Modified the main function in eval.py to use the new scorer function.

Generated with ❤️ by ellipsis.dev

@jxnl jxnl requested a review from ivanleomk February 13, 2024 16:15
Copy link

@ellipsis-dev ellipsis-dev bot left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Changes requested. Reviewed entire PR up to commit f4b5f76

Reviewed 467 lines of code across 2 files in 3 minute(s) and 13 second(s).

See details
  • Skipped files: 0 (please contact us to request support for these files)
  • Confidence threshold: 85%
  • Drafted 2 additional comments.
  • Workflow ID: wflow_SXferBdYytUUTJzJ
View 2 draft comments

These comments were drafted by Ellipsis, but were filtered out of the final review. They're included here so you can see our internal thought process and help you configure your ellipsis.yaml.

Drafted 2 additional comments

Comment at applications/finetune-quora-embeddings/eval.py:2

The result import from unittest is not used in the code. Consider removing it to keep the code clean.

Comment at applications/finetune-quora-embeddings/eval.py:3

The embed import from IPython is not used in the code. Consider removing it to keep the code clean.


Something look wrong? You can customize Ellipsis by editing the ellipsis.yaml for this repository.

Generated with ❤️ by ellipsis.dev

@@ -1,26 +1,44 @@
from distutils.log import Log
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The Log import from distutils.log is not used in the code. Consider removing it to keep the code clean.

@@ -1,4 +1,8 @@
import os
from IPython import embed
from regex import D
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The D import from regex is not used in the code. Consider removing it to keep the code clean.

@@ -1,4 +1,8 @@
import os
from IPython import embed
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The embed import from IPython is not used in the code. Consider removing it to keep the code clean.

train_file: str,
test_file: str,
model= None,
):x
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There is a syntax error at the end of the function signature. Consider removing :x.

y_test = test_df["is_duplicate"]

# Initialize the model
model = LogisticRegression()
model = ()
Copy link

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

The variable model is initialized but not used in the code. Consider removing it to keep the code clean.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant