1484288432 by 2022

1484288432 by 2022

Author:2022
Language: fra
Format: epub


Chapter 4 hugging FaCe

We get the following output:

[[{'label': 'NEGATIVE', 'score': 0.9946781396865845}, {'label':

'POSITIVE', 'score': 0.005321894306689501}],

[{'label': 'NEGATIVE', 'score': 0.001651539234444499},

{'label': 'POSITIVE', 'score': 0.9983484745025635}],

[{'label': 'NEGATIVE', 'score': 0.9994955062866211}, {'label':

'POSITIVE', 'score': 0.0005045001744292676}]]

We can check that the outputs match when we didn’t use and used the pipeline class in our code.

Summary

In this chapter we discussed the architecture of the huggingface library and its components like tokenizers and models. We also learned how we can use these components to do a simple task like analyzing the sentiments of the sentences. In the next chapter, we will take more examples of doing different kinds of tasks using the Transformers library.

67



Download



Copyright Disclaimer:
This site does not store any files on its server. We only index and link to content provided by other sites. Please contact the content providers to delete copyright contents if any and email us, we'll remove relevant links or contents immediately.