0% found this document useful (0 votes)
45 views3 pages

Syntactic Analysis

The document discusses syntactic analysis in natural language processing (NLP), focusing on the structure and grammar of sentences, including part-of-speech (POS) tagging. It outlines the types of POS tags, challenges in analyzing social media text syntactically, and provides a sample code using the SpaCy library for POS tagging and dependency parsing. References for further reading are also included.

Uploaded by

mungaijames6303
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
45 views3 pages

Syntactic Analysis

The document discusses syntactic analysis in natural language processing (NLP), focusing on the structure and grammar of sentences, including part-of-speech (POS) tagging. It outlines the types of POS tags, challenges in analyzing social media text syntactically, and provides a sample code using the SpaCy library for POS tagging and dependency parsing. References for further reading are also included.

Uploaded by

mungaijames6303
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd

SOCIAL INFORMATION AND SENTIMENTS ANALYSIS

SDS2402 GROUP ASSIGNMENT


DUE:10TH DECEMBER 2024

VALARIE CHEBET SCT213-C002-0008/2021


CATHERINE NGECHU SCT213-C002-0003/2021
JAMES MUNGAI SCT213-C002-0083/2021
PAUL MUGO SCT213-C002-0060/2021
DENIS GITHAKA SCT213-C002-0002/2020
GROUP MEMBERS

Syntactic Analysis

Syntactic analysis in natural language processing (NLP) refers to the process of analyzing the
structure and grammar of a sentence or text to understand the relationships between words and
phrases. This analysis involves identifying the syntactic categories of words (such as nouns,
verbs, adjectives, etc.) and how they are organized in a sentence according to the rules of a given
language.

By understanding the structure of a sentence, we can identify grammatical errors and improve
writing.

Part-of-speech (POS) Tagging is the process of assigning different labels known as POS tags to
the words in a sentence that tells us about the part-of-speech of the word.

Types of POS tags

1. Universal POS Tags: These tags are used in the Universal Dependencies (UD), a project
that is developing cross-linguistically consistent treebank annotation for many languages.
These tags are based on the type of words. E.g., NOUN (Common Noun),
ADJ(Adjective), ADV(Adverb).

2. Detailed POS Tags: These tags are the result of the division of universal POS tags into
various tags, like NNS for common plural nouns and NN for the singular common noun
compared to NOUN for common nouns in English.

Challenges in analyzing social medial text syntatically


1. Dependency parsing is the process of analyzing the grammatical structure of a sentence
based on the dependencies between the words in a sentence.

2. Word ambiguity: Many words in a corpora have multiple meanings and parts of speech
depending on the context. For instance, “bat” can be a noun (a flying mammal) or a verb
(to hit something). A part-of-speech tagger needs to consider the surrounding words to
assign the correct tag.

3. Words and complex grammar: Part-of-speech taggers are trained on large amounts of
training data, but they can struggle with words they haven’t encountered before (out-of-
vocabulary words) or languages with complex grammatical structures.

4. Idioms and slang: Informal language constructs often don’t follow standard grammar
rules, making them difficult to tag accurately.

5. Domain dependence: A part-of-speech tagger trained on a general dataset might not


perform well on very specific domains, like legal documents or medical reports.

6. Perception: The interpretation of a text can vary depending on individual perception,


which can affect how parts of speech are tagged.

7. Cardinal numbers: Numbers can be challenging as they can function as nouns, adjectives,
or even other parts of speech depending on their use in a sentence.

8. Transformation-based methods: These methods refine initial tagging decisions based on a


set of learned rules, improving accuracy but adding complexity to the tagging process.

import spacy

# Load the English language model

nlp = [Link]("en_core_web_sm")

# Sample text

text = "I love programming in Python."

# POS Tagging

doc = nlp(text)
print("POS Tags:")

for token in doc:

print(f"{[Link]}: {token.pos_}")

# Dependency Parsing

print("\nDependency Parsing:")

for token in doc:

print(f"{[Link]} --> {token.dep_} --> {[Link]}")

References

1) [Link]
parsing-and-constituency-parsing-in-nlp/#:~:text=Now%2C%20you%20know%20what
%20POS,in%20a%20sentence%20and%20constituency
2) [Link]

You might also like