Jump to main content

Write a Program to Analyze Text and Guess the Author

1
2
3
4
5
51 reviews

Summary

Areas of Science
Difficulty
Method
Time Required
Long (2-4 weeks)
Prerequisites

Programming experience in a language of your choice

Material Availability

Readily available

Cost
Very Low (under $20)
Safety

No issues

Credits
Science Buddies is committed to creating content authored by scientists and educators. Learn more about our process and how we use AI.
*Note: For this science project, you will need to develop your own experimental procedure. Use the information on this page as a starting place. If you would like to discuss your ideas or need help troubleshooting, use the Ask An Expert forum. Our Experts won't do the work for you, but they will make suggestions and offer guidance if you come to them with specific questions.

If you want a Project Idea with full instructions, please pick one without an asterisk (*) at the end of the title.

Abstract

Do you think you could figure out if two different anonymous messages were written by the same person? What about telling the difference between text written by a human and something written by artificial intelligence (AI)? How about identifying the author of a historical text? Each individual author may have their own personal style, and analyzing text mathematically can help you identify that style. Can you write a computer program that takes a passage of text as input, and calculates the average number of words in each sentence and the average number of letters in each word? You can copy and paste the passages of text from online articles or e-books. It will work best if you use whole paragraphs or pages of text and not just a few sentences. If you run the program with text input from different authors, do you get different results? Can you "train" your program on multiple sets of text from two different authors (for example, news articles from two different journalists), and then use it to identify the author of an unknown article? 

Analyzing text has many other uses. Here are just a few ideas:

To do this project, you will need to know how to handle strings (sequences of characters) in a programming language of your choice. If you need help getting started, check out these resources from the Raspberry Pi Foundation to learn more about programming and strings in languages like Scratch, JavaScript, and Python.

icon scientific method

Ask an Expert

Do you have specific questions about your science project? Our team of volunteer scientists can help. Our Experts won't do the work for you, but they will make suggestions, offer guidance, and help you troubleshoot.

Careers

If you like this project, you might enjoy exploring these related careers:

Career Profile
Are you interested in developing cool video game software for computers? Would you like to learn how to make software run faster and more reliably on different kinds of computers and operating systems? Do you like to apply your computer science skills to solve problems? If so, then you might be interested in the career of a computer software engineer. Read more
Career Profile
Have you ever seen a story on the news about how a company or government agency was "hacked" and people's personal information, like names, addresses, or credit card numbers, was stolen? It is an information security analyst's job to prevent that from happening. Organizations hire information security analysts to analyze possible threats against their computer systems, which can range from malicious hackers trying to steal data to careless employees who accidentally forget to log out of a… Read more
Career Profile
Have you ever tried to read a scientific or technical article in a professional journal? They can be hard to decipher because they are full of technical terminology. But have you ever read a science article in a magazine that was geared for your age or for the general public? These tend to be a lot easier to read and more interesting because they have been written by a science writer. A science writer can take a complex subject and write a concise article in language that is easy for… Read more

News Feed on This Topic

 
, ,

Cite This Page

General citation information is provided here. Be sure to check the formatting, including capitalization, for the method you are using and update your citation, as needed.

MLA Style

Finio, Ben. "Write a Program to Analyze Text and Guess the Author." Science Buddies, 9 July 2024, https://www.sciencebuddies.org/science-fair-projects/project-ideas/CompSci_p022/computer-science/computer-sleuth-identification-by-text-analysis?from=sort_choice. Accessed 9 June 2026.

APA Style

Finio, B. (2024, July 9). Write a Program to Analyze Text and Guess the Author. Retrieved from https://www.sciencebuddies.org/science-fair-projects/project-ideas/CompSci_p022/computer-science/computer-sleuth-identification-by-text-analysis?from=sort_choice


Last edit date: 2024-07-09
Top
Free science fair projects.