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

Write a pseudo code for an O (n7log3n) algorithm. Please write in C++.
Write a pseudo code for an O (n7log3n) algorithm. Please write in C++.
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.
Given a BST and a sum, write pseudo code to determine if the tree has a...
Given a BST and a sum, write pseudo code to determine if the tree has a root- to-leaf path such that adding up all the values along the path equals the given sum. Given the below BST and sum = 49, the array is (8, 4, 10, 1, 0, 3, 9, 15, 16). Return true, as there exist a root-to-leaf path 8− > 10− > 15− > 16 which sum is 49.
*Please give the answers in pseudo code 1) Design an algorithm that will receive two integer...
*Please give the answers in pseudo code 1) Design an algorithm that will receive two integer items from a terminal operator, and display to the screen their sum, difference, product and quotient. Note that the quotient calculation (first integer divided by second integer) is only to be performed if the second integer does not equal zero. 2) Design an algorithm that will read two numbers and an integer code from the screen. The value of the integer code should be...
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?
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT