Skip to content

Commit cbbc7f2

Browse files
authored
Merge branch 'Open-Deep-ML:main' into main
2 parents 4ce8159 + 9b97881 commit cbbc7f2

File tree

761 files changed

+2945
-0
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

761 files changed

+2945
-0
lines changed
Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
https://youtu.be/R_OISH-JWPA

Problems/129_Unigram/learn.md

Lines changed: 37 additions & 0 deletions

Problems/129_Unigram/solution.py

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
s='''<s> I am Jack </s>
2+
<s> Jack I am </s>
3+
<s> Jack I like </s>
4+
<s> Jack I do like </s>
5+
<s> do I like Jack </s>'''
6+
7+
def unigram_calculation(s,word):
8+
tokens=s.split()
9+
total_word_count=len(tokens)
10+
word_count=tokens.count(word)
11+
unigram_p=word_count/total_word_count
12+
return round(unigram_p,4)
13+
14+
def test():
15+
16+
#test case 1 for the word Jack
17+
assert unigram_calculation(s,"Jack")==0.1852,"Test Case 1 Failed !"
18+
19+
#test case 2 for the word like
20+
assert unigram_calculation(s,"like")==0.1111,"Test Case 2 Failed !"
21+
22+
23+
if __name__ == "__main__":
24+
test()
25+
print("All Unigram tests passed.")
26+
Binary file not shown.
Binary file not shown.

Problems/interactive_learn/problem-10/docs/.nojekyll

Whitespace-only changes.
14.1 KB
38.2 KB
12.6 KB

Problems/interactive_learn/problem-10/docs/assets/ConnectedDataExplorerComponent-34A-uM7o.js

Lines changed: 22 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)