Question

In: Computer Science

pseudo-code, please If a word has a tag O, it means that the word has nothing...

pseudo-code, please

If a word has a tag O, it means that the word has nothing to do with the named entity (it is not a part of a named entity such as a location, person name, organization, and etc.)

If a word has a tag starting with B, it means that the word is the beginning of a named entity. For instance, the tag B-per means that the associated word is the beginning of a person's name. On the other hand, if a word has a tag starting with I, it means the word is inside a named entity. Hence, the tag I-per means that the associated word is inside a person's name.

Thousands O

of O

demonstrators O

have O

marched O

through O

London B-geo

Take the following lines in the file for example.

President B-per

Mahmoud I-per

Ahmadinejad I-per

said O

We know the words “President, Mahmoud, and Ahmadinejad” cover a named entity of the type person name.

Could you write pseudo code to pull the names out of a file that are stated in the example

Solutions

Expert Solution

Pseudocode:

Pseudocode in simple terms is step by step explanation of a program or arranging the sequence of tasks :

Here we have made use of If-Else as well as switch-case statement structure :

pseudocode for given scenario:

Using If-Else:

Begin

Input a word

If Word has Tag=”O”

                “Not a part of named Entity”

ElseIf Word has Tag=”B”

                “word is the beginning of a named entity

ElseIf Word has Tag=”B-per”

                “associated word is the beginning of a person's name

ElseIf Word has Tag =”I”

                “Word is inside named entity”

Else                //( Word has Tag =”I-Per”)

                “associated word is inside a person's name.

End If

End

Using Switch case:

Begin

Input word(names out of file)

Case based on tag

                Case=”O”

                                Report “Not a part of named Entity”

                Case=”B”

                                Report “word is the beginning of a named entity

                Case=”B-per”

                                Report “associated word is the beginning of a person's name

                Case=”I”

                                Report “Word is inside named entity”

                Case=”I-per”

                                Report “associated word is inside a person's name.

                End Case

End

I hope this will help, if not please comment below i will help you.

Please do not forget to Upvote the answer!!

Happy Learning!!


Related Solutions

Please post all code in Pseudo code. Please post ORIGINAL answers do not copy from similar...
Please post all code in Pseudo code. Please post ORIGINAL answers do not copy from similar questions. Please post in a format that can be directly copied. Reasoning on answers would be most helpful but not required. Thank you in advance for your help. 1. List the following functions according to their order of growth from the lowest to the highest: (n−2)!, 5lg(n+100)10, 22n, 0.001n4 +3n3 +1, ln2 n, √3 n, 3n. 2. The range of afinite nonempty set of...
Develop an algorithm for INSERTION SORT. Give the pseudo-code version. Convert your pseudo-code into a Java...
Develop an algorithm for INSERTION SORT. Give the pseudo-code version. Convert your pseudo-code into a Java program.
In pseudo-code, design an algorithm for finding baking a cake.
In pseudo-code, design an algorithm for finding baking a cake.
can someone translate this pseudo code to actual c++ code while (not the end of the...
can someone translate this pseudo code to actual c++ code while (not the end of the input) If the next input is a number read it and push it on the stack else If the next input is an operator, read it pop 2 operands off of the stack apply the operator push the result onto the stack When you reach the end of the input: if there is one number on the stack, print it else error
Translate following pseudo-code to MIPS assembly language cout << “\n Please input a number for $s0”;...
Translate following pseudo-code to MIPS assembly language cout << “\n Please input a number for $s0”; cin >> $s0; cout << “\n Please input a number for $s1”; cin >> $s1; cout << “\n Please input a number for $s2”; cin >> $s2; $t0 = $s0 / 8 - 2 * $s1 + $s2; cout << “\n the Value of the expression “$s0 / 8 - 2 * $s1 + $s2” is ”; cout >> $t0; return;
Provided code: .data arrayB: .word 0xffff, 0xffff, 0xffff, 0xffff .text Using syscalls o A “syscall” is...
Provided code: .data arrayB: .word 0xffff, 0xffff, 0xffff, 0xffff .text Using syscalls o A “syscall” is a function that is provided by the operating system of the MIPS computer, not by the MIPS architecture itself. Examples are the ability to print data to the MIPS computer’s display monitor, obtain the time of day, etc. o Open the MARS help screen, and select the Syscalls tab to bring up the available syscalls. Find and review the section “How to use SYSCALL...
Please explain what section 1.164-1 in the Internal Revenue Code means?
Please explain what section 1.164-1 in the Internal Revenue Code means?
produce the pseudo code for the Barber routine Clipaway() and the Customer routine Cutmyhair() such that...
produce the pseudo code for the Barber routine Clipaway() and the Customer routine Cutmyhair() such that each customer is given a customized haircut and each customer pays for the Barber’s service. The Sleeping Barber Problem This works for a shop that holds a total of N customers with one barber. If a customer cannot enter the shop, the customer will be forced into the street. Start the Barber before the customers. Shared variables: const int num_chairs = N; // number...
A customer in a grocery store is purchasing three items. Write the pseudo code that will:...
A customer in a grocery store is purchasing three items. Write the pseudo code that will: • Ask the user to enter the name of the first item purchased. Then ask the user to enter the cost of the first item purchased. Make your program user friendly. If the user says the first item purchased is milk, then ask: “What is the cost of milk.” [This should work no matter what item is entered by the user. I might buy...
Please write a pep/9 assembly code that checks if a word or number is a palindrome
Please write a pep/9 assembly code that checks if a word or number is a palindrome
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT