Introducci贸n y Fundamentos del NLP
Procesamiento de Lenguaje Natural
Configuraci贸n del Entorno y Exploraci贸n de Datos
Preprocesamiento Inicial
Quiz: Introducci贸n y Fundamentos del NLP
T茅cnicas Tradicionales de NLP para Documentos Empresariales
Tokenizaci贸n, Stemming y Lematizaci贸n
Visualizaci贸n y generaci贸n de nubes de palabras
Representaci贸n Vectorial: Bag-of-Words y TF-IDF
Extracci贸n de T茅rminos Clave y Modelado de Temas
Clasificaci贸n Tradicional para An谩lisis de Sentimientos y Categor铆as
Quiz: T茅cnicas Tradicionales de NLP para Documentos Empresariales
Introducci贸n y Profundizaci贸n en Transformers para Aplicaciones Empresariales
Fundamentos de Transformers y su Relevancia en NLP
Tokenizaci贸n Avanzada con Transformers y Hugging Face
Uso de Modelos Preentrenados de Transformers para Clasificaci贸n
Reconocimiento de Entidades (NER) en Documentos Corporativos con Transformers
Fine-Tuning de Transformers para Datos Empresariales
Quiz: Introducci贸n y Profundizaci贸n en Transformers para Aplicaciones Empresariales
Proyecto Final y Estrategia Comercial B2B
Desarrollo y Prototipado de la Aplicaci贸n Empresarialparte 1
Desarrollo y Prototipado de la Aplicaci贸n Empresarialparte 2
Despliegue del proyecto en Hugging Face
You don't have access to this class
Keep learning! Join and start boosting your career
Named Entity Recognition (NER) is a fundamental technique in natural language processing that allows identifying and classifying specific elements within a text. This capability is invaluable for companies that need to analyze product mentions, locations or dates in user comments. Through Transformer models, we can implement powerful solutions that automate this process of extracting valuable information.
To implement named entity recognition using Transformer, we need to follow a structured process that starts with the proper definition of the pipeline. It is crucial to select the right model according to the language and type of data we will be working with.
The first step is to import the Pipeline library and configure it correctly:
# We import Pipelinefrom transformers import pipeline
# We configure the pipeline for NER in Spanishner = pipeline("ner", model="mrm8488/bert-spanish-cased-finetuned-ner", tokenizer="mrm8488/bert-spanish-cased-finetuned-ner").
It is important to note that we must define the pipeline according to the language (in this case Spanish) and the type of data we will process (product reviews). For NER tasks, we use a Spanish-specific BERT model that has been trained for entity recognition.
When working with Transformer models, it is recommended to use a GPU to optimize performance and processing speed.
Let's look at a practical example to better understand how this process works:
# Review example review = "Samsung Galaxy S twenty-one product arrived on March twelfth and exceeded my expectations."
# We apply the NER modelresult = ner(review)print(result).
By executing this code, we will get a dictionary with detailed information about the detected entities. The model identifies different types of entities:
The results of the NER model include special labels that help us to understand the structure of the entities:
For example, in the above review, the model would detect "Samsung Galaxy S twenty-one" as an organization, with "Sam" marked as B-ORG (organization start) with 99% certainty, followed by tokens marked as I-ORG (continuation).
To reconstruct the complete entity, we must join all related tokens:
# reconstruction of thereconstructed entityreconstructed_entity = "Samsung Galaxy S twenty-one"print(f "Reconstructed entity: {reconstructed_entity}").
Named entity recognition offers multiple benefits for text analysis:
Let's look at some additional examples:
review1 = "I bought the HP laptop in Madrid, and the customer service was excellent."review2 = "The Canon EOS Rebel camera has impressive image quality, ideal for professionals."review3 = "The Casio watch I bought is water resistant and very accurate."
# We apply the model to each reviewresult1 = ner(review1)result2 = ner(review2)result3 = ner(review3)
In these examples, the model would identify:
A common question is whether these models can recognize entities that have recently emerged. The ability of NER models to identify new brands or products is surprisingly good, even with terms that did not exist during their training.
For example, if we analyze a review that mentions "Deep-Seek" (a recent AI model), the system could correctly identify it as a miscellaneous entity, demonstrating its ability to adapt to new terms.
review_new = "The recently released Deep-Seek model has impressive capabilities."new_result = ner(review_new)
This feature makes entity recognition a valuable tool for detecting trending topics, new brands and emerging products in the market.
Named entity recognition represents a powerful tool for extracting structured information from unstructured text. Its implementation with Transformer models facilitates the automatic analysis of large volumes of textual data, allowing companies to obtain valuable insights about their product mentions, competition and user preferences. Have you ever used this technology in your projects? Share your experience in the comments.
Contributions 0
Questions 0
Want to see more contributions, questions and answers from the community?