Found via `codespell -S .mypy_cache,yarn.lock,*.json,*.ipynb -L
rouge,nam,vie`
This commit is contained in:
Kian-Meng Ang
2023-02-06 03:18:03 +08:00
committed by GitHub
parent 364a4f5aa3
commit 1e321a6fca
32 changed files with 50 additions and 50 deletions
+2 -2
View File
@@ -57,7 +57,7 @@ conversation, or at least as a prompt with replies.
guarantee of the quality of the tweets.
- The tweet quality is the other major issue. We can get conversations through
the currently made scripts, but they most likely don't match a useful
instruction -> fulfilment. We are trying to filter the tweets through various
instruction -> fulfillment. We are trying to filter the tweets through various
means such as matching useful hashtags, or by using cosine similarity against
known instructions.
- The modern Twitter API has conversation_id as a field which can be a way to
@@ -68,7 +68,7 @@ conversation, or at least as a prompt with replies.
## TODO
- Write scripts to filter existing conversations into useful instructions ->
fulfilment with hashtags or cosine similarity.
fulfillment with hashtags or cosine similarity.
- Train model to detect if text is a suitable instruction. This could then be
run through the conversations (or full tweet dump) to simplify the process.
Related to issue #143.
@@ -9,7 +9,7 @@
# This assumes data downloaded from https://archive.org/details/twitterstream
# and that the internal .tar files are extracted locally.
# They are large files so using something like 7Zip or WinRar migth be easier
# They are large files so using something like 7Zip or WinRar might be easier
# than putting all of it in scripts, but it is a possibility.
# I often work in notebooks. If you encounter any issue, please reach out to let me know.
+2 -2
View File
@@ -94,7 +94,7 @@ class EssayReviser(DataAugmenter):
def parse_single(self, essay):
instructions = []
# Make stucture error (shuffle one paragraph with another)
# Make structure error (shuffle one paragraph with another)
essay_paragraphs = essay.split("\n\n") # Splitting a String by newline character (\n)
rand1 = random.randint(0, len(essay_paragraphs) - 1)
@@ -424,7 +424,7 @@ class CodeInstructor(DataAugmenter):
def recognize_entities(text, model, n=4, person="ignore"):
"""Given a text and a model for entity recognition, return the most occuring entites in the text as a string"""
"""Given a text and a model for entity recognition, return the most occurring entities in the text as a string"""
doc = model(text)
if person == "ignore":
ents = Counter([ent.text.strip() for ent in list(doc.ents) if len(ent.text.strip()) >= 5])
+1 -1
View File
@@ -66,7 +66,7 @@ def get_winner(pairs):
def get_ranking(pairs):
"""
Abuses concordance property to get a (not necessarily unqiue) ranking.
Abuses concordance property to get a (not necessarily unique) ranking.
The lack of uniqueness is due to the potential existence of multiple
equally ranked winners. We have to pick one, which is where
the non-uniqueness comes from
+3 -3
View File
@@ -58,7 +58,7 @@ def score_update_votes(new_vote: int, consensus: npt.ArrayLike, voter_data: Vote
after that voter cast a vote on a question.
This function is only to be run when archiving a question
i.e. the question has had sufficiently many votes, or we cann't get more than "K" bits of information
i.e. the question has had sufficiently many votes, or we can't get more than "K" bits of information
The consensus is the array of all votes cast by all voters for that question
We then update the voter data using the new information
@@ -88,7 +88,7 @@ def score_update_prompts(consensus: npt.ArrayLike, voter_data: Voter) -> Voter:
This function returns the gain of points for a given prompt's votes
In contrast to the other score updating functions, we can run this online as new votes come in.
i.e. the question has had sufficiently many votes, or we cann't get more than "K" bits of information.
i.e. the question has had sufficiently many votes, or we can't get more than "K" bits of information.
Parameters:
@@ -122,7 +122,7 @@ def score_update_ranking(user_ranking: npt.ArrayLike, consensus_ranking: npt.Arr
This function returns the gain of points for a given ranking's votes
This function is only to be run when archiving a question
i.e. the question has had sufficiently many votes, or we cann't get more than "K" bits of information
i.e. the question has had sufficiently many votes, or we can't get more than "K" bits of information
we use the bubble-sort distance (or "kendall-tau" distance) to compare the two rankings
we use this over spearman correlation since:
+1 -1
View File
@@ -56,7 +56,7 @@ def next_answer_task(possible_prompts, answers_per_prompt):
This helps to not have too much close-to-finished prompts in the active set.
Parameters:
possible_prompts (dict[prompt_id, num_answers]): a dictonary containing all open prompts and the number of answers these prompts currently have.
possible_prompts (dict[prompt_id, num_answers]): a dictionary containing all open prompts and the number of answers these prompts currently have.
answers_per_prompt (int): number of answers we per prompt to target
Returns:
prompt_id (int): the prompt_id corresponding to the next prompt that should get a new answer