Skip to content
This repository has been archived by the owner on Dec 25, 2023. It is now read-only.

Laboratory work #4, Mashkovtseva Alesia - 22FPL2 #196

Closed
wants to merge 122 commits into from

Conversation

alesiamashkovtseva
Copy link

No description provided.

Copy link

@marina-kaz marina-kaz left a comment

Choose a reason for hiding this comment

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

Nothing to review today

Copy link

@marina-kaz marina-kaz left a comment

Choose a reason for hiding this comment

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

Great!!

Don't forget to remove unused code

@@ -28,6 +32,22 @@ def _tokenize(self, text: str) -> tuple[str, ...]: # type: ignore
Raises:
ValueError: In case of inappropriate type input argument or if input argument is empty.
"""
if not isinstance(text, str) or not text:
raise ValueError('Type input is inappropriate or input argument is empty.')
text = repr(text)

Choose a reason for hiding this comment

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

I will need an explanation :)

for letter in word:
if not result or (len(result) > 2 and result[-2] == '.'):
result += letter.upper()
else:

Choose a reason for hiding this comment

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

Can we write it without else?

Copy link
Author

Choose a reason for hiding this comment

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

fixed

elif generator_type == 1:
self._generator = TopPGenerator(language_model, word_processor, 0.5)
elif self._generator_type == 2:
self._generator = BeamSearchTextGenerator(language_model, word_processor, 5)

Choose a reason for hiding this comment

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

maybe use dictionary here? to avoid situations when it is not initialized due to wrong input

Copy link
Author

Choose a reason for hiding this comment

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

fixed

@alesiamashkovtseva alesiamashkovtseva changed the title Laboratory work #4, Mashkovtseva Alesia - 22FLP2 Laboratory work #4, Mashkovtseva Alesia - 22FPL2 Dec 12, 2023
Copy link

@marina-kaz marina-kaz left a comment

Choose a reason for hiding this comment

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

Good!
There are some unaddressed comments though, answer them or react

@vitazaytseva
Copy link

Well done! Good job!

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

Successfully merging this pull request may close these issues.

4 participants