Code Monkey home page Code Monkey logo

amanjeetsahu / natural-language-processing-specialization Goto Github PK

View Code? Open in Web Editor NEW
736.0 15.0 656.0 292.43 MB

This repo contains my coursework, assignments, and Slides for Natural Language Processing Specialization by deeplearning.ai on Coursera

Home Page: https://www.coursera.org/specializations/natural-language-processing

Jupyter Notebook 98.68% Python 1.32%
natural-language-processing natural-language-understanding natural-language-generation nlp nlp-machine-learning course coursera specialization course-materials coursera-specialization

natural-language-processing-specialization's Issues

Week1 Assignment # UNQ_C10 GRADED FUNCTION

December 2022, I had to change the following function to pass all test cases

`# UNQ_C10 GRADED FUNCTION: get_corrections
def get_corrections(word, probs, vocab, n=2, verbose = False):
'''
Input:
word: a user entered string to check for suggestions
probs: a dictionary that maps each word to its probability in the corpus
vocab: a set containing all the vocabulary
n: number of possible word corrections you want returned in the dictionary
Output:
n_best: a list of tuples with the most probable n corrected words and their probabilities.
'''

suggestions = []
n_best = []

### START CODE HERE ###
#Step 1: create suggestions as described above    
suggestions = list((word in vocab and word) or edit_one_letter(word).intersection(vocab) or edit_two_letters(word).intersection(vocab))
n_best = [[s,probs[s]] for s in list(reversed(suggestions))]
n_best = sorted(n_best, key=lambda x: x[1])[::-1][:n]
### END CODE HERE ###

if verbose: print("entered word = ", word, "\nsuggestions = ", suggestions)

return n_best`

C1_W3_Assignment - get_country

Hello,

In C1_W3_Assignment, "get_country", "word_embeddings" is used, which is a global variable.
In order for the assignment tests to pass, the local variable "embeddings" needs to be used instead.

Original work

Excuse me, Could u please upload the original version of this work? cuz I want to do it myself, thx!

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.