#B3759. [信息与未来 2021] 文本分类

[信息与未来 2021] 文本分类

Description

虽然属于“人工智能”的范畴,但分类问题也可以简单理解成是一个计算机函数 ff,它输入一系列数据(例如代表图片颜色的二维数组、代表文本的字符串等),f(x)f(x) 返回 0011,其中 11 则代表 xx 具有某种特征,属于这一分类。

今天,大家要挑战一项文本的分类任务:识别一个单词序列是由英文书写的,还是由汉语拼音书写的。以下分别是两段文字,是用汉语拼音和英文书写的,你能正确地分类吗?

  1. While a number of definitions of artificial intelligence (AI) have surfaced over the last few decades, John McCarthy offers the following definition in this 2004 paper, " It is the science and engineering of making intelligent machines, especially intelligent computer programs. It is related to the similar task of using computers to understand human intelligence, but AI does not have to confine itself to methods that are biologically observable."

  2. Ren gong zhi neng shi yan jiu、kai fa yong yu mo ni、yan shen he kuo zhan ren.de zhi neng de li lun、fang fa ji ying yong xi tong de yi men xin de ji shu ke xue.

Input Format

输入数据的第一行是你需要分类文本的任务数量 TT

接下来 TT 行,每行描述了一个文本分类任务,首先是整数 nn 表示单词的个数,接下来 nn 个空格分隔的、仅由小写字母 az\tt{a}\sim \tt{z} 组成的字符串代表了一段待分类的文本。输入保证每个单词(对中文来说是每个字)之间都有一个空格。

Output Format

为每个分类任务输出一行,如果待分类的文本是拼音书写的,输出 Pinyin,如是英文书写的,输出 English(注意 PinyinEnglish 的大小写)。

2
14 zhe ge ti mu qi shi bi ni xiang xiang de yao jian dan
6 this problem has a simple solution
Pinyin
English

Hint

对于 100%100\% 的数据,满足 1T10,103n1041\leq T\leq 10,10^3\leq n\leq 10^4 并且文本都来自真实、易于人类阅读的文本。

本题原始满分为 15pts15\text{pts}